Skip to content

Commit

Permalink
Fix ElementSearchDialog Autocomplete onChange (#305)
Browse files Browse the repository at this point in the history
Signed-off-by: sBouzols <[email protected]>
  • Loading branch information
sBouzols authored Oct 3, 2023
1 parent 59202b0 commit 7a8eb28
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/ElementSearchDialog/element-search-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ const ElementSearchDialog = (props) => {
handleSearchTermChange(value);
}
}}
onChange={(_event, newValue) => {
onSelectionChange(newValue);
setValue(null);
onChange={(_event, newValue, reason) => {
if (reason === 'selectOption') {
onSelectionChange(newValue);
setValue(newValue);
} else {
setValue(null);
}
}}
getOptionLabel={(option) => option.label}
isOptionEqualToValue={(option, value) =>
Expand Down

0 comments on commit 7a8eb28

Please sign in to comment.