fix: shortcut should be without modifier keys

This commit is contained in:
Phan An 2024-03-18 22:08:34 +01:00
parent 739291c001
commit 8bb1c34ba4
2 changed files with 3 additions and 4 deletions

View file

@ -2,9 +2,7 @@
<div ref="scroller" v-koel-overflow-fade class="virtual-scroller" @scroll.passive="onScroll">
<div :style="{ height: `${totalHeight}px` }">
<div :style="{ transform: `translateY(${offsetY}px)`}">
<template v-for="item in renderedItems">
<slot :item="item" />
</template>
<slot v-for="item in renderedItems" :item="item" />
</div>
</div>
</div>

View file

@ -10,7 +10,8 @@ import { favoriteStore, queueStore } from '@/stores'
const onKeyStroke = (key: KeyFilter, callback: (e: KeyboardEvent) => void) => {
baseOnKeyStroke(key, e => {
if ( (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement)) return
if (e.altKey || e.ctrlKey || e.metaKey) return
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return
e.preventDefault()
callback(e)
})