From af8ee1ebca15f9327c8c3e0277c3266ed344ee66 Mon Sep 17 00:00:00 2001 From: onatm Date: Tue, 29 Aug 2017 20:38:18 +0100 Subject: [PATCH] add onNewOptionClick prop to ReactCreatableSelectProps --- types/react-select/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 35e5bf127d..5906c96d6b 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -7,6 +7,7 @@ // Mark Vujevits // Mike Deverell // MartynasZilinskas +// Onat Yigit Mercan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -49,6 +50,7 @@ declare namespace ReactSelectClass { type OnChangeSingleHandler = OnChangeHandler>; type OnChangeMultipleHandler = OnChangeHandler>; type OnChangeHandler = (newValue: TOption | null) => void; + type OnNewOptionClickHandler = (option: Option) => void; type LoadOptionsHandler = LoadOptionsAsyncHandler | LoadOptionsLegacyHandler; type LoadOptionsAsyncHandler = (input: string) => Promise; @@ -453,6 +455,11 @@ declare namespace ReactSelectClass { * Decides if a keyDown event (eg its 'keyCode') should result in the creation of a new option. */ shouldKeyDownEventCreateNewOption?: ShouldKeyDownEventCreateNewOptionHandler; + + /** + * new option click handler: function (option) {} + */ + onNewOptionClick?: OnNewOptionClickHandler; } interface ReactAsyncSelectProps extends ReactSelectProps {