Skip to content

Commit

Permalink
Merge pull request #6098 from melloware/PR6097
Browse files Browse the repository at this point in the history
Fix #6097: MultiSelect pass selected option to event
  • Loading branch information
nitrogenous authored Mar 18, 2024
2 parents b385527 + 50e23db commit 6fc252f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const MultiSelect = React.memo(
.filter((option) => isValidOption(option))
.map((option) => getOptionValue(option));

updateModel(event, value);
updateModel(event, value, value);
}
};

Expand All @@ -138,7 +138,7 @@ export const MultiSelect = React.memo(
if (selected) value = props.value.filter((val) => !ObjectUtils.equals(val, getOptionValue(option), equalityKey));
else value = [...(props.value || []), getOptionValue(option)];

updateModel(event, value);
updateModel(event, value, option);
index !== -1 && setFocusedOptionIndex(index);
};

Expand Down Expand Up @@ -349,7 +349,7 @@ export const MultiSelect = React.memo(
if (event.code === 'KeyA' && metaKey) {
const value = visibleOptions.filter((option) => isValidOption(option)).map((option) => getOptionValue(option));

updateModel(event, value);
updateModel(event, value, value);

event.preventDefault();
break;
Expand Down

0 comments on commit 6fc252f

Please sign in to comment.