palantir/blueprint

The default value of showDialogKeyCombo (?) only works in certain keyboard layouts

开放

#4,849 创建于 2021年8月9日

 (9 条评论) (1 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
Domain: accessibilityDomain: i18nP2Package: coreType: bughelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (平均合并 43天 10小时) (30 天内合并 27 个 PR)

描述

Environment

  • Package version(s): @blueprintjs/core 3.47.0
  • Operating System: Ubuntu 21.04
  • Browser name and version: Electron 13.1.8 (reproduces on Chrome 92.0.4515.107 as well)

Code Sandbox

Link to a minimal repro: https://blueprintjs.com/docs/#core/hooks/use-hotkeys (yes, that's your own documentation, it also reproduces there)

Steps to reproduce

  1. Set your keyboard layout to Spanish (example)
  2. Focus the piano on the documentation.
  3. Try to open the key combo dialog by typing ?.

Actual behavior

Nothing. The ? doesn't get registered. It also doesn't work as a regular "combo" in HotkeyConfig.

Note that Electron and Chrome both catch that key if you use document.body.onkeydown. Also, on gmail, the ? hotkey works well with my layout.

Expected behavior

The key combo dialog opens.

Possible solution

If I set my keyboard layout to English/US, then ? works, both in showDialogKeyCombo as well as HotkeyConfig. Of course this is not a great workaround... I can't just ask all my users to change their keyboard layout to use my app. I don't know the blueprint codebase well enough to propose other alternatives. Happy to help with debugging if you point me in the right direction.

贡献者指南