prevent scroll is no player is highlighted

This commit is contained in:
2023-05-04 21:53:54 +02:00
parent ef060980f7
commit 008c5a799a
+1 -1
View File
@@ -47,7 +47,7 @@ export default defineComponent({
this.vlistHeight = (this.$refs.vlist as HTMLElement)?.getBoundingClientRect().height || 0 this.vlistHeight = (this.$refs.vlist as HTMLElement)?.getBoundingClientRect().height || 0
}, },
highlighted (newVal) { highlighted (newVal) {
setTimeout(() => (this.$refs.vlist as HTMLElement)?.scrollBy({ top: ((this.list.findIndex(e => e.id === newVal)) * this.rowHeight) - ((this.$refs.vlist as HTMLElement))?.scrollTop - (this.vlistHeight / 2 - this.$props.rowHeight), behavior: 'smooth' }), 1) if (newVal) setTimeout(() => (this.$refs.vlist as HTMLElement)?.scrollBy({ top: ((this.list.findIndex(e => e.id === newVal)) * this.rowHeight) - ((this.$refs.vlist as HTMLElement))?.scrollTop - (this.vlistHeight / 2 - this.$props.rowHeight), behavior: 'smooth' }), 1)
} }
}, },
methods: { methods: {