Skip to content

InfinityScroll

Unofficial

Virtual scrolling component that renders only visible items in large lists for performance.

Import:

import type { InfinityScroll } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface InfinityScroll

Properties

PropertyTypeDescription
heightnumberCurrent visible height of the scroll container.
lastScrollnumberLast recorded scroll position.
queuednull | unknownQueued computation task, or null if none is pending.
renderBlockSizenumberNumber of items to render per block.
rootElunknownRoot element of the virtual scroll container.
scrollElHTMLElementScrollable element that handles scroll events.
setWidthbooleanWhether the width should be explicitly set on items.
widthnumberCurrent visible width of the scroll container.

Methods

MethodReturnsDescription
_layout(x, y)unknownInternal method to perform layout calculations.
_measure(x)unknownInternal method to measure element dimensions.
_precompute(x)unknownInternal method to precompute layout information.
compute(x)unknownCompute visible items and update the virtual display.
findElementTop(x, y, z)unknownFind the top position of an element within the scroll container.
getRootTop()unknownGet the top offset of the root element.
invalidate(x, y)unknownInvalidate the cached layout for specific items.
invalidateAll()unknownInvalidate all cached layout information.
measure(x, y)unknownMeasure dimensions for the given elements.
onResize()unknownHandle resize events and recalculate layout.
onScroll()unknownHandle scroll events and update the virtual display.
queueCompute()unknownQueue a deferred computation of visible items.
scrollIntoView(x, y)unknownScroll the container to bring the specified element into view.
update(x, y, z, u, v, w)unknownUpdate the virtual scroll state with new parameters.
updateVirtualDisplay(x)unknownUpdate the virtual display to reflect current scroll position.

Links to this page: