Skip to content

Commit

Permalink
Toggle if it is open, to avoid multiple selectors being open.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfra committed Dec 20, 2024
1 parent 35ba742 commit 63db22c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,13 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
'aria-expanded': isOpen,
};
const removeButtonProps = {
onClick: onRemove,
onClick: ( e ) => {
e.stopPropagation();
if ( isOpen ) {
onToggle();
}
onRemove();
},
className: clsx(
'edit-site-global-styles__shadow-editor__remove-button',
{ 'is-open': isOpen }
Expand Down

0 comments on commit 63db22c

Please sign in to comment.