Skip to content

bug(docs): search keybind (for command palette) non-functional on windows #3869

Open
@lrstanley

Description

@lrstanley

Environment

  • Operating System: Windows 11
  • Browsers: Firefox, Chrome (latest for each)

Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.x (docs)

Reproduction

On Windows 11, hitting windows key + k, per the docs for meta_k when using defineShortcuts, which is what looks like the search command palette on the docs is using, does not get passed into the website itself (or even the browser). I've tried ctrl and other keybinds with no success either.

I've tested on both Chrome and Firefox, neither work.

Description

Using the following javascript in the browser console on each:

window.addEventListener("keydown", function (event) {
  console.log(event)
})

window.addEventListener("keyup", function (event) {
  console.log(event)
})

A few things I notice:

  1. Holding Windows key (meta) does trigger the keydown event, but pressing k, Windows intercepts, and doesn't trigger a keydown event. Assume this is because Windows 10 or 11 is intercepting for this "cast" feature (below).
  2. Pressing k first, then Windows key (meta), both trigger keydown, but neither trigger keyup. k triggers keydown, but then Windows key (meta) doesn't.

Additional context

tl;dr: probably easiest to support ctrl+k. ctrl+f is typical for basic browser text search, so ctrl+k makes the most sense (and it's what most sites use). I've never seen sites use windows keys for anything, because it's meant for windows functionality. Alternatively, supporting / would be nice, some sites use this.

Not critical, just the keybind to search docs faster. Plus, the search icon is so small in the docs navbar that I often misclick when trying to search the docs.

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriagev3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions