Skip to content

Commit

Permalink
Set isLoading to false if cache hit
Browse files Browse the repository at this point in the history
From @youtogod in the comments of JedWatson#2012:

> Add this would be better : `this.setState({ isLoading: false, options: cache[inputValue] });`. Otherwise when hitting the cache during a promise, the loading icon will remain and the menu won't appear.
  • Loading branch information
timhwang21 committed Oct 8, 2017
1 parent 7523c20 commit 8cfff2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default class Async extends Component {
this._callback = null;

this.setState({
isLoading: false,
options: cache[inputValue]
});

Expand Down

0 comments on commit 8cfff2d

Please sign in to comment.