Skip to content

Commit

Permalink
Merge pull request #6045 from melloware/PR6044
Browse files Browse the repository at this point in the history
Fix #6044: Autocomplete reset selectedItem if value cleared
  • Loading branch information
nitrogenous authored Mar 18, 2024
2 parents c31ba2e + 363be01 commit 2cf4c38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/autocomplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const AutoComplete = React.memo(

const updateModel = (event, value) => {
// #2176 only call change if value actually changed
if (selectedItem && ObjectUtils.deepEquals(selectedItem.current, value)) {
if (selectedItem.current && ObjectUtils.deepEquals(selectedItem.current, value)) {
return;
}

Expand Down Expand Up @@ -607,6 +607,8 @@ export const AutoComplete = React.memo(
});
}

selectedItem.current = null;

return null;
};

Expand Down

0 comments on commit 2cf4c38

Please sign in to comment.