From e796f9b060d88b5cd905482388b3d3a32db0dc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Tegn=C3=A9r?= Date: Wed, 16 Mar 2016 18:57:02 +0100 Subject: [PATCH] Correctly filter items when selecting a state, fixes #81 The `onSelect` logic was setting `state.unitedStates` to an empty array which gave the impression that there were no matching results when the menu was reopened. --- examples/custom-menu/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/custom-menu/app.js b/examples/custom-menu/app.js index f18a0149..3685156d 100644 --- a/examples/custom-menu/app.js +++ b/examples/custom-menu/app.js @@ -28,7 +28,7 @@ let App = React.createClass({ inputProps={{name: "US state", id: "states-autocomplete"}} items={this.state.unitedStates} getItemValue={(item) => item.name} - onSelect={value => this.setState({ value, unitedStates: [] }) } + onSelect={(value, state) => this.setState({ value, unitedStates: [state] }) } onChange={(event, value) => { this.setState({ value, loading: true }) fakeRequest(value, (items) => {