Skip to content

Overlays don't trap focus #50

Closed

Description

@Shewart

Summary

With a Dialog, Sheet, Drawer or AlertDialog open, Tab moves focus to elements behind the overlay. Keyboard and screen-reader users can end up in content they can't see.

Steps to reproduce

  1. Open any Dialog.
  2. Press Tab repeatedly.

Expected: focus cycles through the dialog's focusable elements only, and returns to the trigger when the dialog closes.
Actual: focus leaves the dialog and reaches the page behind it.

Suggested fix

A small focus-trap helper in shellui.js (package and CLI template), called when an overlay opens and released when it closes: focus the first focusable element (or the content), wrap Tab / Shift+Tab, restore focus to the trigger on close. Apply it to Dialog, AlertDialog, Sheet and Drawer, and add tests.

Activity

  1. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions