From f6af6a08cf77a57aa21f6c95498fc97aa343f001 Mon Sep 17 00:00:00 2001 From: Andrey Medvedev Date: Sat, 27 Jul 2024 13:59:50 +0300 Subject: [PATCH] Fix primefaces#6927: Removing chips in multiselect cause open/close multiselect --- components/lib/multiselect/MultiSelect.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/lib/multiselect/MultiSelect.js b/components/lib/multiselect/MultiSelect.js index 93baf114de..625969c331 100644 --- a/components/lib/multiselect/MultiSelect.js +++ b/components/lib/multiselect/MultiSelect.js @@ -158,7 +158,7 @@ export const MultiSelect = React.memo( }; const onClick = (event) => { - if (!props.inline && !props.disabled && !props.loading && !isPanelClicked(event) && DomHandler.getAttribute(event.target, 'data-pc-section') !== 'removetokenicon' && !isClearClicked(event)) { + if (!props.inline && !props.disabled && !props.loading && !isPanelClicked(event) && !isClearClicked(event)) { overlayVisibleState ? hide() : show(); DomHandler.focus(inputRef.current); event.preventDefault(); @@ -825,6 +825,8 @@ export const MultiSelect = React.memo( }; const removeChip = (event, item) => { + event.stopPropagation(); + const value = props.value.filter((val) => !ObjectUtils.equals(val, item, equalityKey)); if (props.onRemove) {