admin管理员组文章数量:1399482
I can't figure out what prop to use to disable a Creatable React-select ponent, is it just missing?
I tried the regular isDisabled prop but was unsuccessful.
<CreatableSelect
name="serviceOrders"
className="hide-options"
value={selectOptions()}
isDisabled={headerLock}
onChange={e => {
this.handleHeaderChange(
e,
'serviceOrders',
);
}}
placeholder="Type SO, then press enter..."
multi
/>
I want to disable it for specific situations.
I can't figure out what prop to use to disable a Creatable React-select ponent, is it just missing?
I tried the regular isDisabled prop but was unsuccessful.
<CreatableSelect
name="serviceOrders"
className="hide-options"
value={selectOptions()}
isDisabled={headerLock}
onChange={e => {
this.handleHeaderChange(
e,
'serviceOrders',
);
}}
placeholder="Type SO, then press enter..."
multi
/>
I want to disable it for specific situations.
Share Improve this question edited Feb 1, 2019 at 4:37 Shubham Khatri 282k58 gold badges431 silver badges411 bronze badges asked Feb 1, 2019 at 4:02 joshmkjoshmk 4258 silver badges24 bronze badges1 Answer
Reset to default 5The isDisabled
prop for Select ponents is applicable for react-select v2 and above. In case you are using a version 1.x.x please use the disabled
prop to disable the select ponent
render() {
return (
<CreatableSelect
isClearable
isDisabled
onChange={this.handleChange}
onInputChange={this.handleInputChange}
options={colourOptions}
/>
);
}
Working demo with v2
本文标签: javascriptHow do I disable a Creatable reactselect componentStack Overflow
版权声明:本文标题:javascript - How do I disable a Creatable react-select component? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744223702a2595990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论