Skip to content

Commit

Permalink
Merge pull request JedWatson#1363 from leesiongchan/fix-creatable
Browse files Browse the repository at this point in the history
Fix onInputChange lost
  • Loading branch information
JedWatson authored Nov 11, 2016
2 parents bd5e52e + a91f539 commit 603bfdd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Creatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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;
},
Expand Down

0 comments on commit 603bfdd

Please sign in to comment.