class@af-utils/virtual-lit
On this page

VirtualController

Lit reactive controller owning a virtual model and its three layout refs.

Implements

  • ReactiveController

Constructors

Constructor

new VirtualController(
   host, 
   params, 
   hostEvents?): VirtualController;

Create and register a virtual model controller.

Parameters

host

ReactiveControllerHost

params

() => VirtualScrollerInitialParams

hostEvents?

number = 0

Returns

VirtualController

Properties

itemsRef

readonly itemsRef: Ref<HTMLElement>;

Attach the element containing only the rendered item range.


scrollerRef

readonly scrollerRef: Ref<HTMLElement>;

Attach the visible scroll viewport.


sizeRef

readonly sizeRef: Ref<HTMLElement>;

Attach the element representing the complete native scroll size.

Accessors

model

Get Signature

get model(): VirtualScroller;

Current model, recreated after a terminal host disconnect.

Returns

VirtualScroller

Methods

hostConnected()

hostConnected(): void;

Recreate resources after a completed disconnect.

Returns

void

Implementation of

ReactiveController.hostConnected

hostDisconnected()

hostDisconnected(): void;

Dispose model resources with the host.

Returns

void

Implementation of

ReactiveController.hostDisconnected

hostUpdated()

hostUpdated(): void;

Synchronize model parameters after each host update.

Returns

void

Implementation of

ReactiveController.hostUpdated