From b5f41a026ed77fb988a05e07b752ca187211ec76 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Mon, 13 Feb 2017 15:43:30 -0500 Subject: [PATCH] add `disabled` property to the `Option` type --- react-select/index.d.ts | 5 +++++ react-select/react-select-tests.tsx | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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 = {