From 5b0ba593b86ae43a53941d30258006edc390ec85 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 5 May 2023 09:18:00 +0100 Subject: [PATCH] Move modal consideration CSS selector up a few levels to underlay to prevent modal close clicks triggering external handlers --- packages/bbui/src/Actions/click_outside.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Actions/click_outside.js b/packages/bbui/src/Actions/click_outside.js index add1378812..1961dca47c 100644 --- a/packages/bbui/src/Actions/click_outside.js +++ b/packages/bbui/src/Actions/click_outside.js @@ -26,8 +26,8 @@ const handleClick = event => { } // Ignore clicks for modals, unless the handler is registered from a modal - const sourceInModal = handler.anchor.closest(".spectrum-Modal") != null - const clickInModal = event.target.closest(".spectrum-Modal") != null + const sourceInModal = handler.anchor.closest(".spectrum-Underlay") != null + const clickInModal = event.target.closest(".spectrum-Underlay") != null if (clickInModal && !sourceInModal) { return }