Fix scrollToIndex
This commit is contained in:
parent
d1b8190dca
commit
fa68ff76d8
|
@ -85,9 +85,10 @@ const scrollToCurrent = (behavior: ScrollBehavior = 'smooth') => {
|
||||||
watchDebounced(currentTrack, () => scrollToCurrent(), { debounce: 100 })
|
watchDebounced(currentTrack, () => scrollToCurrent(), { debounce: 100 })
|
||||||
whenever(
|
whenever(
|
||||||
() => store.state.ui.queueFocused,
|
() => store.state.ui.queueFocused,
|
||||||
() => {
|
async () => {
|
||||||
list.value?.scrollToIndex(currentIndex.value)
|
list.value?.scrollToIndex(currentIndex.value)
|
||||||
setTimeout(() => scrollToCurrent('auto'), 1)
|
await nextTick()
|
||||||
|
requestAnimationFrame(() => scrollToCurrent('auto'))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,7 @@ const { resume, pause } = useRafFn(() => {
|
||||||
}, { immediate: false })
|
}, { immediate: false })
|
||||||
|
|
||||||
const virtualList = ref()
|
const virtualList = ref()
|
||||||
|
window.vl = virtualList
|
||||||
defineExpose({
|
defineExpose({
|
||||||
scrollToIndex: (index: number) => virtualList.value?.scrollToItem(index),
|
scrollToIndex: (index: number) => virtualList.value?.scrollToItem(index),
|
||||||
cleanup
|
cleanup
|
||||||
|
|
|
@ -344,7 +344,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.drag-container:not(.dragging) .queue-item:hover {
|
.drag-container:not(.dragging) .hover .queue-item {
|
||||||
background: rgba(0,0,0,.05);
|
background: rgba(0,0,0,.05);
|
||||||
color: #000000f2;
|
color: #000000f2;
|
||||||
}
|
}
|
Loading…
Reference in New Issue