Skip to content

Commit 6b56fc1

Browse files
authored
Merge pull request #2281 from basecamp/fix-card-hotkeys
Ignore hotkeys with modifiers
2 parents 0634dda + d7ef796 commit 6b56fc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/javascript/controllers/card_hotkeys_controller.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class extends Controller {
1010
}
1111

1212
handleKeydown(event) {
13-
if (this.#shouldIgnore(event)) return
13+
if (this.#shouldIgnore(event) || this.#hasModifier(event)) return
1414

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

40+
#hasModifier(event) {
41+
return event.metaKey || event.ctrlKey || event.altKey || event.shiftKey
42+
}
43+
4044
get #selectedCard() {
4145
// Find the navigable-list that currently has focus
4246
const focusedList = this.navigableListOutlets.find(list => list.hasFocus)

0 commit comments

Comments
 (0)