From 5c47367881c93fe644769377b363572ece1a360a Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 6 Mar 2024 08:49:24 -0500 Subject: [PATCH 1/2] Fix #6097: MultiSelect pass selected option to event --- components/lib/multiselect/MultiSelect.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/lib/multiselect/MultiSelect.js b/components/lib/multiselect/MultiSelect.js index e2b1250305..fa3c7b18f5 100644 --- a/components/lib/multiselect/MultiSelect.js +++ b/components/lib/multiselect/MultiSelect.js @@ -123,7 +123,7 @@ export const MultiSelect = React.memo( .filter((option) => isValidOption(option)) .map((option) => getOptionValue(option)); - updateModel(event, value); + updateModel(event, value, value); } }; @@ -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, value); index !== -1 && setFocusedOptionIndex(index); }; @@ -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; From 50e23dbbdf81a7cf244bdccfd20e8805bb3f5abb Mon Sep 17 00:00:00 2001 From: Melloware Date: Wed, 6 Mar 2024 09:33:48 -0500 Subject: [PATCH 2/2] Update MultiSelect.js --- components/lib/multiselect/MultiSelect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/multiselect/MultiSelect.js b/components/lib/multiselect/MultiSelect.js index fa3c7b18f5..6d1ae2f93b 100644 --- a/components/lib/multiselect/MultiSelect.js +++ b/components/lib/multiselect/MultiSelect.js @@ -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, value); + updateModel(event, value, option); index !== -1 && setFocusedOptionIndex(index); };