Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 5621d0f

Browse files
committed
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.
1 parent 9078d54 commit 5621d0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/custom-menu/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let App = React.createClass({
2525
inputProps={{name: "US state"}}
2626
items={this.state.unitedStates}
2727
getItemValue={(item) => item.name}
28-
onSelect={() => this.setState({ unitedStates: [] }) }
28+
onSelect={(_, state) => this.setState({ unitedStates: [state] }) }
2929
onChange={(event, value) => {
3030
this.setState({loading: true})
3131
fakeRequest(value, (items) => {

0 commit comments

Comments
 (0)