Skip to content

Commit 5895889

Browse files
committed
🐛 Fix: shift key function in gallery page
1 parent 58420c8 commit 5895889

File tree

2 files changed

+608
-191
lines changed

2 files changed

+608
-191
lines changed

src/renderer/pages/Gallery.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,12 @@ export default class extends Vue {
178178
document.addEventListener('keyup', this.handleDetectShiftKey)
179179
}
180180
handleDetectShiftKey (event: KeyboardEvent) {
181-
if (event.keyCode === 16) {
182-
this.isShiftKeyPress = !this.isShiftKeyPress
181+
if (event.key === 'Shift') {
182+
if (event.type === 'keydown') {
183+
this.isShiftKeyPress = true
184+
} else if (event.type === 'keyup') {
185+
this.isShiftKeyPress = false
186+
}
183187
}
184188
}
185189
get filterList () {

0 commit comments

Comments
 (0)