Fix scrollToIndex

This commit is contained in:
wvffle 2022-07-24 23:57:41 +00:00 committed by Georg Krause
parent d1b8190dca
commit fa68ff76d8
3 changed files with 5 additions and 3 deletions

View File

@ -85,9 +85,10 @@ const scrollToCurrent = (behavior: ScrollBehavior = 'smooth') => {
watchDebounced(currentTrack, () => scrollToCurrent(), { debounce: 100 })
whenever(
() => store.state.ui.queueFocused,
() => {
async () => {
list.value?.scrollToIndex(currentIndex.value)
setTimeout(() => scrollToCurrent('auto'), 1)
await nextTick()
requestAnimationFrame(() => scrollToCurrent('auto'))
}
)

View File

@ -156,6 +156,7 @@ const { resume, pause } = useRafFn(() => {
}, { immediate: false })
const virtualList = ref()
window.vl = virtualList
defineExpose({
scrollToIndex: (index: number) => virtualList.value?.scrollToItem(index),
cleanup

View File

@ -344,7 +344,7 @@
}
}
.drag-container:not(.dragging) .queue-item:hover {
.drag-container:not(.dragging) .hover .queue-item {
background: rgba(0,0,0,.05);
color: #000000f2;
}