From a91f539c74da674c4be66ff856c085e8ce8d09d7 Mon Sep 17 00:00:00 2001 From: Chan Lee Siong Date: Fri, 11 Nov 2016 11:51:48 +0800 Subject: [PATCH] Fix onInputChange lost --- src/Creatable.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Creatable.js b/src/Creatable.js index 9d2ec905c7..e701b0527b 100644 --- a/src/Creatable.js +++ b/src/Creatable.js @@ -31,6 +31,9 @@ const Creatable = React.createClass({ // ({ label: string, labelKey: string, valueKey: string }): Object newOptionCreator: React.PropTypes.func, + // input change handler: function (inputValue) {} + onInputChange: React.PropTypes.func, + // input keyDown handler: function (event) {} onInputKeyDown: React.PropTypes.func, @@ -155,6 +158,12 @@ const Creatable = React.createClass({ }, onInputChange (input) { + const { onInputChange } = this.props; + + if (onInputChange) { + onInputChange(input); + } + // This value may be needed in between Select mounts (when this.select is null) this.inputValue = input; },