Skip to content

[BUG] Custom Shortcuts Shadow Global "Escape" Key Behavior (Functional Bug) #671

Description

@Niteshagarwal01

Describe the bug
The application's global Escape key functionality (used to close side drawers, modals, and the search overlay) is broken. The RouteAwareChrome component registers a custom escape handler via useKeyboardShortcuts to close the Shortcut Legend. Because the hook architecture executes custom handlers before global default handlers and immediately returns, the global fallback for Escape is completely shadowed and never reached.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any page on the DevPath application.
  2. Press Ctrl+K (or click the Search icon) to open the global Search Modal.
  3. Press the Escape key on your keyboard.
  4. See error: The Search Modal remains open, and the escape key is entirely ignored.

Expected behavior
Pressing the Escape key should reliably close any currently open overlay, including the Search Modal, Mobile Menu, Bookmark Drawer, and the Shortcut Legend.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: All
  • Browser: All
  • Version: Latest

Smartphone (please complete the following information):

  • Device: N/A
  • OS: N/A
  • Browser: N/A

Additional context
Files affected: src/components/layout/RouteAwareChrome.tsx and src/hooks/useKeyboardShortcuts.ts. The custom escape handler in RouteAwareChrome prevents the hook from dispatching the close-all-overlays event.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions