From 03145618e3907a81f4bfc2c405914ab17bfee197 Mon Sep 17 00:00:00 2001 From: chenzhihao Date: Wed, 29 Jun 2016 15:44:21 +0800 Subject: [PATCH] Fix async loadOptions bug. We should not return a promise here. The retured value will be used at handleInputChange() of Select.js. And this value will be used to setState as 'inputValue' which will become '[object Promise]'. --- src/Select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Select.js b/src/Select.js index a91e0de747..a21a7182ed 100644 --- a/src/Select.js +++ b/src/Select.js @@ -383,7 +383,7 @@ const Select = React.createClass({ if (this.state.inputValue !== event.target.value && this.props.onInputChange) { let nextState = this.props.onInputChange(newInputValue); // Note: != used deliberately here to catch undefined and null - if (nextState != null && typeof nextState !== 'object') { + if (nextState != null && typeof nextState !== 'object' && typeof nextState.then === 'undefined') { newInputValue = '' + nextState; } }