AltGr characters fire unmodified hotkeys on the same physical key
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
_match.ts から着手する:modifiersMatch(86-87 行目、altGraph の下で Ctrl/Alt をクリアする処理)、53 行目のラテン文字ガード、60-64 行目の code フォールバック、そして 30 行目の Ctrl/Alt ホットキーをすでに処理している直接的な key 経路を読む。AltGr によって生成された文字が物理キーのフォールバックをスキップすべき箇所を決定し、その後、パッケージのテストスイートと issue の 3 つの再現ケースを実行する(いずれも false を返すべき)。完了の意味は、AltGr の押下がマッチしなくなる一方で、既存のホットキーマッチングテストが引き続き通ることである。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
On layouts with AltGr (German, Polish, …), typing an AltGr character fires an unmodified single-key hotkey on the same physical key.
- German AltGr+M types
µand fires aMhotkey. - Polish AltGr+C types
ćand fires aChotkey. - German AltGr+Q types
@and fires aQhotkey.
In _match.ts, modifiersMatch clears Ctrl and Alt when altGraph is set (lines 86–87). The code fallback (lines 60–64) then maps KeyM → M, which matches. For ć, the Latin-letter guard at line 53 is skipped because normalized.alt is true under AltGr. µ and @ aren't Latin letters, so the guard doesn't apply at all.
Reproduce
import { matchesKeyboardEvent } from '@tanstack/hotkeys'
// What Chrome on Windows reports for AltGr+<key>: Ctrl+Alt plus the AltGraph modifier state.
const altGr = (key: string, code: string) =>
({ type: 'keydown', key, code, ctrlKey: true, altKey: true, shiftKey: false, metaKey: false,
isComposing: false, getModifierState: (k: string) => k === 'AltGraph' }) as unknown as KeyboardEvent
matchesKeyboardEvent(altGr('µ', 'KeyM'), 'M', 'windows') // true, expected false
matchesKeyboardEvent(altGr('ć', 'KeyC'), 'C', 'windows') // true, expected false
matchesKeyboardEvent(altGr('@', 'KeyQ'), 'Q', 'windows') // true, expected false
Expected
A key press that produced a character through AltGr is text input and should not fall back to the physical key. Only a direct key match should count, as line 30 already does for hotkeys with Ctrl/Alt.
Versions
@tanstack/hotkeys 0.11.0 and @tanstack/react-hotkeys 0.13.0. _match.ts on main still has the same code.
- 主要言語
- TypeScript
- スター
- 738
- フォーク
- 48
- 平均マージ
- 16時間 23分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/hotkeys のほかの issue
-
ignoreInput isn't detected across realms対応中かも @wojtowicz-artur が 86 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TanStack/hotkeys#105 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
`useKeyHold` / `KeyStateTracker` latches a modifier forever when a `keyup` is swallowed without a `blur` (e.g. macOS Cmd+Shift+4)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
TanStack/hotkeys#143 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
'Space'-shortcut overrides native behavior triggering focused elements対応中かも @KevinVandy が 15 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
TanStack/hotkeys#142 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
TanStack/hotkeys#138 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
TanStack/hotkeys の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
apache/rocketmq-dashboard#6610 ·
メンテナーはふだん 3 日以内に返信
-
nextjs-tracking
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
cloudflare/vinext#3920 ·
メンテナーはふだん 1 日以内に返信
-
Team:Dashboards
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
elastic/kibana#297299 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
analytics beginner friendly community contributions-welcome good first issue hacktoberfest help wanted up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
affected/v17 affected/v18 area/frontend type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
umbraco/Umbraco-CMS#24186 ·
メンテナーはふだん 2 日以内に返信