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 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 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.

贡献者指南