Skip to content

Commit a3e6faf

Browse files
committed
fix: native keyboard shortcuts always prevented, closes #1726
1 parent 3674f29 commit a3e6faf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/app-frontend/src/util/keyboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { onMounted, onUnmounted } from '@vue/composition-api'
22

33
type KeyboardHandler = (event: KeyboardEvent) => boolean | void | Promise<boolean | void>
4+
45
function handleKeyboard (type: 'keyup' | 'keydown', cb: KeyboardHandler) {
56
function handler (event: KeyboardEvent) {
67
if (event.target instanceof HTMLElement && (
@@ -11,7 +12,7 @@ function handleKeyboard (type: 'keyup' | 'keydown', cb: KeyboardHandler) {
1112
}
1213

1314
const result = cb(event)
14-
if (!result) {
15+
if (result === false) {
1516
event.preventDefault()
1617
}
1718
}

0 commit comments

Comments
 (0)