diff --git a/frontend/src/components/misc/Modal.vue b/frontend/src/components/misc/Modal.vue index 5a05e8025..f11763339 100644 --- a/frontend/src/components/misc/Modal.vue +++ b/frontend/src/components/misc/Modal.vue @@ -101,7 +101,7 @@ watchEffect(() => { }) function onKeydown(e: KeyboardEvent) { - if (e.key === 'Escape') { + if (e.code === 'Escape') { if (e.isComposing) { return } diff --git a/frontend/src/components/project/views/ProjectList.vue b/frontend/src/components/project/views/ProjectList.vue index 270f99d14..0ff8a64d1 100644 --- a/frontend/src/components/project/views/ProjectList.vue +++ b/frontend/src/components/project/views/ProjectList.vue @@ -322,13 +322,13 @@ function handleListNavigation(e: KeyboardEvent) { return } - if (e.key === 'j') { + if (e.code === 'KeyJ') { e.preventDefault() focusTask(Math.min(focusedIndex.value + 1, tasks.value.length - 1)) return } - if (e.key === 'k') { + if (e.code === 'KeyK') { e.preventDefault() if (focusedIndex.value === -1) { focusTask(tasks.value.length - 1) @@ -345,7 +345,7 @@ function handleListNavigation(e: KeyboardEvent) { return } - if (e.key === 'Enter') { + if (e.code === 'Enter') { if (e.isComposing) { return } diff --git a/frontend/src/composables/useGanttBar.ts b/frontend/src/composables/useGanttBar.ts index dcfadcc54..4cc68ebc5 100644 --- a/frontend/src/composables/useGanttBar.ts +++ b/frontend/src/composables/useGanttBar.ts @@ -64,31 +64,31 @@ export function useGanttBar(options: UseGanttBarOptions) { function onKeyDown(e: KeyboardEvent) { // task expanding if (e.shiftKey) { - if (e.key === 'ArrowLeft') { + if (e.code === 'ArrowLeft') { e.preventDefault() changeSize('left', 1) } - if (e.key === 'ArrowRight') { + if (e.code === 'ArrowRight') { e.preventDefault() changeSize('right', 1) } } // task shrinking else if (e.ctrlKey) { - if (e.key === 'ArrowLeft') { + if (e.code === 'ArrowLeft') { e.preventDefault() changeSize('left', -1) } - if (e.key === 'ArrowRight') { + if (e.code === 'ArrowRight') { e.preventDefault() changeSize('right', -1) } } // task movement - else if (e.key === 'ArrowLeft' || e.key === 'ArrowRight') { + else if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') { e.preventDefault() - const dir = e.key === 'ArrowRight' ? 1 : -1 + const dir = e.code === 'ArrowRight' ? 1 : -1 const newStart = new Date(options.model.start) newStart.setDate(newStart.getDate() + dir) const newEnd = new Date(options.model.end)