fix: content tab uniqueness regression (#6156)

* fix: content tab uniqueness regression

Closes: #6154

* fix: further regressions

* fix: lint

* fix: lint
This commit is contained in:
Calum H.
2026-05-21 23:03:35 +01:00
committed by GitHub
parent 4e1a61d8b6
commit d077d44540
8 changed files with 77 additions and 36 deletions
@@ -84,9 +84,13 @@ export function useVirtualScroll<T>(items: Ref<T[]>, options: VirtualScrollOptio
const start = Math.floor(relativeScrollTop / itemHeight)
const visibleCount = Math.ceil(viewportHeight.value / itemHeight)
const rangeSize = visibleCount + bufferSize * 2
const rangeStart = Math.max(0, start - bufferSize)
const rangeEnd = Math.min(items.value.length, start + visibleCount + bufferSize * 2)
const rangeStart = Math.min(
Math.max(0, start - bufferSize),
Math.max(0, items.value.length - rangeSize),
)
const rangeEnd = Math.min(items.value.length, rangeStart + rangeSize)
return {
start: rangeStart,