palantir/blueprint

HotkeyProvider doesn't work with F1-F12 keys

Open

#6.508 geöffnet am 5. Nov. 2023

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (20.263 Stars) (2.167 Forks)batch import
Domain: documentationP3Package: coreType: enhancementhelp wanted

Beschreibung

Environment

  • Package version(s): Core 5.6.0
  • Operating System: Windows 11
  • Browser name and version: Google Chrome 119.0.6045.105

Code Sandbox

Link to a minimal repro.

Steps to reproduce

  1. Assign a combo to one of the F1-F12 keys.
  2. Press said button.
  3. Done.

Actual behavior

F1-F12 cannot be asigned as combo values. When I press a value the onKeyDown function is never called.

Expected behavior

When I press F1-F12 it should call the keydown function.

Possible solution

I believe the issue comes because the combo checker checks if the first letter of a combo is a-z so it uses Key<Code>, which probably makes F1 do things as KeyF1 instead of the proper key code.

Contributor Guide