Skip to content

Commit 1235ff3

Browse files
authored
Fix Arrow Navigation prevent + Remove Menu (#26)
Update: - Removed menu from app (Windows: could see it when pressing Alt) Fix: - Issue where when focusing on topics tab prevents all system shortcut from being used
1 parent 75532b6 commit 1235ff3

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/main/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ function createWindow(): void {
4343
}
4444
})
4545

46+
mainWindow.removeMenu()
47+
4648
initIpcMain()
4749

4850
mainWindow.on('close', () => {

src/renderer/src/tabs/TabTopics.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,19 @@ const topicToSelect = (index: number, direction: 'up' | 'down'): string | null =
161161
}
162162
163163
const handleKeyUp = (event: KeyboardEvent) => {
164+
if (['ArrowUp', 'ArrowDown'].includes(event.key)) {
165+
event.preventDefault()
166+
}
167+
164168
if (event.key === 'ArrowUp') handleUpKeyUp()
165169
else if (event.key === 'ArrowDown') handleDownKeyUp()
166170
}
167171
168172
const handleKeyDown = (event: KeyboardEvent) => {
173+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
174+
event.preventDefault()
175+
}
176+
169177
if (event.key === 'ArrowUp') handleUpKeyDown()
170178
else if (event.key === 'ArrowDown') handleDownKeyDown()
171179
else if (event.key === 'ArrowLeft') handleLeftKey()
@@ -314,11 +322,7 @@ const handleScrollNextTopic = (nextTopic: string) => {
314322
/>
315323
</div>
316324
<q-separator />
317-
<div
318-
class="tw-overflow-auto"
319-
@keyup.prevent="handleKeyUp"
320-
@keydown.prevent="handleKeyDown"
321-
>
325+
<div class="tw-overflow-auto" @keyup="handleKeyUp" @keydown="handleKeyDown">
322326
<q-virtual-scroll
323327
id="topicsVirtualScroll"
324328
v-slot="{ item: [_, value] }"

0 commit comments

Comments
 (0)