Skip to content

Commit

Permalink
Fix #2176: AutoComplete only fire onChange if value changed (#2751)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Apr 14, 2022
1 parent 03dc25d commit fdb9f4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/lib/autocomplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export const AutoComplete = React.memo(React.forwardRef((props, ref) => {
}

const updateModel = (event, value) => {
// #2176 only call change if value actually changed
if (selectedItem && selectedItem.current === value) {
return;
}
if (props.onChange) {
props.onChange({
originalEvent: event,
Expand Down

0 comments on commit fdb9f4a

Please sign in to comment.