From 03533ac58f4833fba57a59257fe4ee27b55eb00f Mon Sep 17 00:00:00 2001 From: Tony deCatanzaro Date: Fri, 6 May 2016 10:00:48 -0400 Subject: [PATCH] Fixed a bug where searchingText was not being shown when a refined search did not match any previous results --- src/Async.js | 7 ++++--- test/Async-test.js | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/Async.js b/src/Async.js index 0ab36f8744..66226b5d96 100644 --- a/src/Async.js +++ b/src/Async.js @@ -141,9 +141,10 @@ const Async = React.createClass({ let { isLoading, options } = this.state; if (this.props.isLoading) isLoading = true; let placeholder = isLoading ? this.props.loadingPlaceholder : this.props.placeholder; - if (!options.length) { - if (this._lastInput.length < this.props.minimumInput) noResultsText = this.props.searchPromptText; - if (isLoading) noResultsText = this.props.searchingText; + if (isLoading) { + noResultsText = this.props.searchingText; + } else if (!options.length && this._lastInput.length < this.props.minimumInput) { + noResultsText = this.props.searchPromptText; } return ( ); + }); + }); it('ignores the result of an earlier call, when the responses come in the wrong order', () => {