Skip to content

Commit

Permalink
add callback to refetch search results after item is added and search…
Browse files Browse the repository at this point in the history
… is cleared (#198)
  • Loading branch information
govindsartaj authored Jan 13, 2022
1 parent 9f91fb2 commit dbca389
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ export class Select extends Component {
});
}

this.props.clearOnSelect && this.setState({ search: '' });
this.props.clearOnSelect &&
this.setState({ search: '' }, () => {
this.setState({ searchResults: this.searchResults() });
});

return true;
};
Expand Down

0 comments on commit dbca389

Please sign in to comment.