问题标签 [react-select]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
reactjs - Reactjs 和 redux-form:无法在 redux-form 中包装的 react-select 组件中使用 onChange 或 onBlur
我正在使用react-select
组件,因为我使用的是redux-form
库和它的字段,所以我必须包装 react-select 并在 redux-form 字段中使用它来提交表单值。像这样<Field name="customselect" component={RenderSelectInput} />
。但是,当我使用包装的 react-select 组件时,我无法使用自定义onChange
和函数。onBlur
像这样<Field name="customselect" component={RenderSelectInput} onChange={this.handleChange}/>
这是 RenderSelectInput.js
主页.js
在上面的程序中,正如我提到的,我只想在更改包装的 react-select 中的值时显示“成功”警报。请指导。
谢谢, 沙什
javascript - React Select 选择时不显示值
我是 react-redux 的新手,我有两个问题。我正在使用 eract select plus,如下所示:
但是,当我选择另一个值时,即使触发了该值,它也不会显示在该字段中。另一个问题是我想为我的选择器设置初始值,所以在我的容器中我写:
当我执行我的项目时,我可以看到在状态下这些值确实存在,但没有显示在我的选择字段中。对于第二种情况,我以 redux 形式使用 react-select,并通过以下方式实现它:
redux - 将 async react-select 与 redux-saga 一起使用
我尝试实现异步反应选择(Select.Async)。问题是,我们想在 redux-saga 中进行 fetch。因此,如果用户键入某些内容,则应该触发 fetch-action。Saga 然后获取记录并将它们保存到存储中。到目前为止,这有效。不幸的是 loadOptions 必须返回一个承诺,否则应该调用回调。由于新检索到的选项是通过更改属性传播的,因此我认为无法将Select.Async与 saga 一起使用来执行异步获取调用。有什么建议么?
我有一个技巧,我将回调分配给一个类变量并在 componentWillReceiveProps 上解决它。那样丑陋并且不能正常工作,所以我寻找更好的解决方案。
谢谢
reactjs - 我可以在 react-native 中使用 react-select 吗?
我正在尝试在我的 react-native 应用程序中实现搜索表单。为此,我需要 react-select 或 select-2 之类的东西,这两个工具都是为 Web 系统制作的,我不知道将它用于 react-native 应用程序是否是个好主意。
我已经尝试在 react-native 中安装和使用它,但这似乎不起作用。
selenium - 如何使用 Selenium IDE 处理 React Select 组件
我对 Selenium IDE 位置元素有疑问
这是链接:https ://jedwatson.github.io/react-select/
我用这个命令成功:
但我不知道用这样的相同元素处理下一个字段
问题是如何使用 Selenium IDE 处理这个问题?
javascript - React-select 不显示字段中选择的值
我有一个 react-select 组件,我定义如下:
与opts = [{label: any, value:1}, {label:Two, value:2}]
.
选择时的值通过portfolioSelector
函数存储在状态中。问题是当我选择一个值时,它没有显示在选择字段中。我的主要组件是这样的:
你知道为什么吗?
javascript - Default Value in react-select
i have a react-select component which i made compatible with redux-form. My SelectInput component is this:
and i render it in my component which is a form
I've also set initial values to the container so as the state for this component has an initial value and it's working. My problem is that when i render the component the initial value does not show in the selection box and it's empty. Why is this happenning?
reactjs - 反应选择异步选项未显示
我想在我的react-select
列表中显示搜索结果,当用户单击该选项时,它会将数据完整加载到下表中。
这是我的loadIptions
我将功能发送到我的搜索:
但是我不能在输入中显示它,它保持在加载状态:
任何想法我如何让它显示标题?
reactjs - 如何在 react-select 中设置默认值
我在使用 react-select 时遇到问题。我使用 redux 表单,并且我的 react-select 组件与 redux 表单兼容。这是代码:
以及我如何渲染它:
但问题是我的下拉列表没有我希望的默认值。我做错了什么?有任何想法吗?