Skip to content

Commit

Permalink
Fix #6927: Removing chips in multiselect cause open/close multiselect (
Browse files Browse the repository at this point in the history
  • Loading branch information
meddvedev authored Jul 27, 2024
1 parent 24a956d commit 02c461e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/lib/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 02c461e

Please sign in to comment.