palantir/blueprint

HotkeyProvider doesn't work with F1-F12 keys

開放

#6,508 建立於 2023年11月5日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (2,167 個分叉)batch import
Domain: documentationP3Package: coreType: enhancementhelp wanted

倉庫指標

星標
 (20,263 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南