graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

Cmd+K doesn't work for the docs explorer search in Firefox

Open connorshea opened this issue 3 years ago • 3 comments

in GraphiQL 2.0.2, the docs explorer has a search bar with a keyboard shortcut of "Cmd+K". Unfortunately, in Firefox the Cmd+K shortcut is already bound to opening the "omnibar" in the browser, so the page's listener for Cmd+K appears to be overridden (it seems like it might receive the event trigger, but then focus is lost when the browser triggers its own action off the keyboard shortcut).

Screen Shot 2022-08-27 at 12 34 30 PM

I was able to get the Cmd+K shortcut to work fine in Safari on macOS.

graphiql version: 2.0.2 Firefox version: Nightly, 105.0a1 (2022-08-20) (64-bit) OS: macOS 12.5.1

connorshea avatar Aug 27 '22 18:08 connorshea

Oh, it actually does capture Cmd+K, but only when the user's focus is in the editor itself. Otherwise, Firefox captures the shortcut.

connorshea avatar Aug 27 '22 18:08 connorshea

I think I’ll mark this as an enhancement because it should do this for a11y and other reasons, but it did not before. I think we have a global keybindings ticket somewhere already

acao avatar Aug 27 '22 19:08 acao

@thomasheyenbrock meet @connorshea who contributed the headers pane amongst other bugfixes! @harshithpabbati was helping with these efforts as well iirc

acao avatar Aug 27 '22 19:08 acao