Skip to content

Commit

Permalink
Removed If Condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrogenous committed Apr 25, 2024
1 parent 308e350 commit 53ec258
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions components/lib/autocomplete/AutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ export const AutoComplete = React.memo(
};

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

if (props.onChange) {
props.onChange({
originalEvent: event,
Expand Down Expand Up @@ -255,9 +250,11 @@ export const AutoComplete = React.memo(
};

const removeItem = (event, index) => {

const removedValue = props.value[index];
const newValue = props.value.filter((_, i) => index !== i);


console.log(removedValue, newValue);
updateModel(event, newValue);

if (props.onUnselect) {
Expand Down

0 comments on commit 53ec258

Please sign in to comment.