如何禁用 Creatable react-select 组件?
How do I disable a Creatable react-select component?
我不知道使用什么道具来禁用 Creatable React-select 组件,它只是丢失了吗?
我尝试了常规的 isDisabled 属性但没有成功。
<CreatableSelect
name="serviceOrders"
className="hide-options"
value={selectOptions()}
isDisabled={headerLock}
onChange={e => {
this.handleHeaderChange(
e,
'serviceOrders',
);
}}
placeholder="Type SO, then press enter..."
multi
/>
我想在特定情况下禁用它。
Select 组件的 isDisabled
属性适用于 react-select v2 及更高版本。如果您使用的是 1.x.x 版本,请使用 disabled
属性禁用 select 组件
render() {
return (
<CreatableSelect
isClearable
isDisabled
onChange={this.handleChange}
onInputChange={this.handleInputChange}
options={colourOptions}
/>
);
}
我不知道使用什么道具来禁用 Creatable React-select 组件,它只是丢失了吗?
我尝试了常规的 isDisabled 属性但没有成功。
<CreatableSelect
name="serviceOrders"
className="hide-options"
value={selectOptions()}
isDisabled={headerLock}
onChange={e => {
this.handleHeaderChange(
e,
'serviceOrders',
);
}}
placeholder="Type SO, then press enter..."
multi
/>
我想在特定情况下禁用它。
Select 组件的 isDisabled
属性适用于 react-select v2 及更高版本。如果您使用的是 1.x.x 版本,请使用 disabled
属性禁用 select 组件
render() {
return (
<CreatableSelect
isClearable
isDisabled
onChange={this.handleChange}
onInputChange={this.handleInputChange}
options={colourOptions}
/>
);
}