Keyboard Tab focus escapes modal dialog into background page
Custom div modals fail to mark background subtrees inert or use the native Top Layer, allowing keyboard focus and assistive tech to leak behind the backdrop.
document.activeElement moves behind modal overlay; screen reader navigates background landmarks while dialog is openCausal Chain of Browser Mechanisms
Ordered from trigger to root invariant. Open any mechanism to inspect its internals or reproduce the behavior in an interactive lab.
End z-index: 99999 wars and overflow: hidden modal clipping—the Browser Top Layer paints <dialog> and [popover] in a document-level LIFO list above the root stacking context.
Boolean HTML attribute that removes an entire subtree from pointer hit-testing, keyboard focus order, text selection, find-in-page, and the accessibility tree.
HTML primitive placing modals in the browser Top Layer above any z-index, with built-in focus management and Escape key handling.
Keyboard navigation pattern that reduces a multi-item composite widget to a single Tab stop by toggling tabindex='0' onto the active descendant while keeping siblings at tabindex='-1'.