solid-dismiss
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -882,6 +882,7 @@ import { insert, template, delegateEvents, addEventListener, effect, setAttribute, classList, createComponent, mergeProps } from 'solid-js/web'; | ||
menuPopupEl, | ||
containerEl | ||
containerEl, | ||
focusSentinelBeforeEl | ||
} = dismissStack[dismissStack.length - 1]; | ||
const menuBtnEl = getMenuButton(menuBtnEls); | ||
const activeElement = document.activeElement; | ||
let activeElement = document.activeElement; | ||
let direction; | ||
@@ -895,4 +896,5 @@ | ||
if (activeElement === menuBtnEl || activeElement === menuPopupEl) { | ||
if (activeElement === menuBtnEl || activeElement === menuPopupEl || activeElement === containerEl) { | ||
direction = "forwards"; | ||
activeElement = focusSentinelBeforeEl; | ||
} | ||
@@ -903,3 +905,3 @@ | ||
direction, | ||
stopAtElement: containerEl | ||
stopAtElement: menuPopupEl | ||
}); | ||
@@ -1864,2 +1866,3 @@ | ||
focusElementOnClose, | ||
focusSentinelBeforeEl: state.focusSentinelBeforeEl, | ||
upperStackRemovedByFocusOut: false, | ||
@@ -1866,0 +1869,0 @@ detectIfMenuButtonObscured: false, |
@@ -188,5 +188,5 @@ import { dismissStack } from "./dismissStack"; | ||
return; | ||
const { menuBtnEls, menuPopupEl, containerEl } = dismissStack[dismissStack.length - 1]; | ||
const { menuBtnEls, menuPopupEl, containerEl, focusSentinelBeforeEl } = dismissStack[dismissStack.length - 1]; | ||
const menuBtnEl = getMenuButton(menuBtnEls); | ||
const activeElement = document.activeElement; | ||
let activeElement = document.activeElement; | ||
let direction; | ||
@@ -199,4 +199,7 @@ if (e.key === "ArrowDown") { | ||
} | ||
if (activeElement === menuBtnEl || activeElement === menuPopupEl) { | ||
if (activeElement === menuBtnEl || | ||
activeElement === menuPopupEl || | ||
activeElement === containerEl) { | ||
direction = "forwards"; | ||
activeElement = focusSentinelBeforeEl; | ||
} | ||
@@ -206,3 +209,3 @@ const el = getNextTabbableElement({ | ||
direction, | ||
stopAtElement: containerEl, | ||
stopAtElement: menuPopupEl, | ||
}); | ||
@@ -209,0 +212,0 @@ if (el) { |
@@ -413,2 +413,3 @@ import "./browserInfo"; | ||
focusElementOnClose, | ||
focusSentinelBeforeEl: state.focusSentinelBeforeEl, | ||
upperStackRemovedByFocusOut: false, | ||
@@ -415,0 +416,0 @@ detectIfMenuButtonObscured: false, |
import { TDismiss } from ".."; | ||
import { TLocalState } from "../local/localState"; | ||
export declare type TDismissStack = Pick<TDismiss, "focusElementOnClose" | "overlayElement" | "open" | "setOpen"> & Pick<TLocalState, "timeouts" | "uniqueId" | "cursorKeys" | "closeWhenDocumentBlurs" | "closeWhenMenuButtonIsTabbed" | "closeWhenEscapeKeyIsPressed" | "upperStackRemovedByFocusOut" | "menuPopupEl" | "overlayEl" | "overlay"> & { | ||
export declare type TDismissStack = Pick<TDismiss, "focusElementOnClose" | "overlayElement" | "open" | "setOpen"> & Pick<TLocalState, "timeouts" | "uniqueId" | "cursorKeys" | "closeWhenDocumentBlurs" | "closeWhenMenuButtonIsTabbed" | "closeWhenEscapeKeyIsPressed" | "upperStackRemovedByFocusOut" | "menuPopupEl" | "overlayEl" | "overlay" | "focusSentinelBeforeEl"> & { | ||
id: string; | ||
@@ -5,0 +5,0 @@ menuBtnEls: HTMLElement[]; |
{ | ||
"name": "solid-dismiss", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"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 not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
286639
3864
0