solid-dismiss
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -7,3 +7,3 @@ import { dismissStack } from "../global/dismissStack"; | ||
export const onFocusOutContainer = (state, e) => { | ||
const { overlayElement, trapFocus, timeouts, closeWhenDocumentBlurs, mountedPopupsSafeList, uniqueId, } = state; | ||
const { overlayElement, trapFocus, timeouts, closeWhenDocumentBlurs, mountedPopupsSafeList, } = state; | ||
timeoutFocusOutFired = false; | ||
@@ -21,3 +21,3 @@ if (globalState.thirdPartyPopupEl) { | ||
return; | ||
console.log("container focusout", uniqueId); | ||
const dismissStackLength = dismissStack.length; | ||
setTimeoutFocusOut(timeouts, () => { | ||
@@ -30,2 +30,6 @@ if (mountedPopupsSafeList) { | ||
} | ||
// fixes issue where race condition of new item mounts before timeout focusout fires | ||
// therefore focused item which is menuButton, the new container doesn't contain, so removes stack | ||
if (dismissStackLength < dismissStack.length) | ||
return; | ||
globalState.closedByEvents = true; | ||
@@ -35,3 +39,2 @@ checkThenClose(dismissStack, (item) => { | ||
const clickTarget = globalState.clickTarget; | ||
console.log({ clickTarget }, uniqueId); | ||
if (clickTarget && containerEl.contains(clickTarget)) { | ||
@@ -51,4 +54,3 @@ return { continue: false }; | ||
export const onFocusInContainer = (state, e) => { | ||
const { uniqueId, timeouts } = state; | ||
console.log("container focusin", uniqueId); | ||
const { timeouts } = state; | ||
clearTimeout(timeouts.containerFocusTimeoutId); | ||
@@ -55,0 +57,0 @@ clearTimeout(timeouts.menuButtonBlurTimeoutId); |
{ | ||
"name": "solid-dismiss", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"homepage": "https://aquaductape.github.io/solid-dismiss/", | ||
@@ -5,0 +5,0 @@ "description": "Handles \"click outside\" behavior for popup menu. Closing is triggered by click/focus outside of popup element or pressing \"Escape\" key.", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
343622
4645