diff --git a/react-select/index.d.ts b/react-select/index.d.ts index b149fd4c47..5393888f3b 100644 --- a/react-select/index.d.ts +++ b/react-select/index.d.ts @@ -29,6 +29,11 @@ declare namespace ReactSelectClass { * @default true */ clearableValue?: boolean; + /** + * Do not allow this option to be selected + * @default false + */ + disabled?: boolean; } export interface MenuRendererProps { diff --git a/react-select/react-select-tests.tsx b/react-select/react-select-tests.tsx index 7840f2ce9e..10a3f51833 100644 --- a/react-select/react-select-tests.tsx +++ b/react-select/react-select-tests.tsx @@ -140,7 +140,15 @@ class SelectTest extends React.Component, {}> { class SelectWithStringValueTest extends React.Component, {}> { render() { - const options: Option[] = [{ label: "Foo", value: "bar" }]; + const options: Option[] = [{ + label: "Foo", + value: "bar", + }, { + label: "Foo2", + value: "bar2", + clearableValue: false, + disabled: true + }]; const onChange = (value: any) => console.log(value); const selectProps: ReactSelectProps = {