Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/javascript/controllers/card_hotkeys_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class extends Controller {
}

handleKeydown(event) {
if (this.#shouldIgnore(event)) return
if (this.#shouldIgnore(event) || this.#hasModifier(event)) return

Comment on lines 12 to 14

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Hotkeys unreachable on layouts requiring modifier keys

Ignoring all keydown events with any modifier (meta/ctrl/alt/shift) means users on keyboard layouts that require AltGr/Option or another modifier to type [ or ] can no longer trigger the postpone/close card shortcuts at all. The intent was to avoid system shortcuts like Command+[ on macOS, but this guard also blocks legitimate hotkey usage for non‑US layouts that need modifiers to emit those characters.

Useful? React with 👍 / 👎.

const handler = this.#keyHandlers[event.key.toLowerCase()]
if (handler) {
Expand All @@ -37,6 +37,10 @@ export default class extends Controller {
target.closest("input, textarea, [contenteditable], lexxy-editor")
}

#hasModifier(event) {
return event.metaKey || event.ctrlKey || event.altKey || event.shiftKey
}

get #selectedCard() {
// Find the navigable-list that currently has focus
const focusedList = this.navigableListOutlets.find(list => list.hasFocus)
Expand Down