From dbca3894c28c4548d890274e37ad4c0bb66b29ed Mon Sep 17 00:00:00 2001 From: Govind Brahmanyapura Date: Thu, 13 Jan 2022 05:48:32 -0600 Subject: [PATCH] add callback to refetch search results after item is added and search is cleared (#198) --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 46725d87..58aff43f 100644 --- a/src/index.js +++ b/src/index.js @@ -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; };