Skip to content

[A11Y] Implement Keyboard Shortcut (Ctrl+K) for Global Search #471

@Aditya948351

Description

@Aditya948351

Description

Power users and developers prefer keeping their hands on the keyboard. We should add a global Ctrl+K (or Cmd+K on Mac) shortcut to instantly open the search modal.

Proposed Solution

  1. Add a global event listener for the keydown event.
  2. Check if (event.ctrlKey || event.metaKey) && event.key === "k".
  3. If true, prevent the default browser behavior and toggle the Search Modal state to open.
  4. Ensure the search input is automatically focused when the modal opens.

Expected Outcome

A faster, more accessible search experience mimicking tools like Vercel and GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions