Skip to content

Commit

Permalink
forms: RemoteSelectField: Fix searching with same query
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 authored and kpsherva committed Aug 12, 2024
1 parent e26b6cf commit 44d5f1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/forms/RemoteSelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export class RemoteSelectField extends Component {
executeSearch = async (searchQuery) => {
const { preSearchChange, serializeSuggestions } = this.props;
const query = preSearchChange(searchQuery);
// If there is no query, then display prevState suggestions
// If there is no query change, then display prevState suggestions
const { searchQuery: prevSearchQuery } = this.state;
if (prevSearchQuery === "") {
if (prevSearchQuery === searchQuery) {
return;
}
this.setState({ isFetching: true, searchQuery: query });
Expand Down

0 comments on commit 44d5f1a

Please sign in to comment.