Quartz Headless docs/findRelativeItem

Search documentation

Type to search the documentation.

API: Core

findRelativeItem

Next/previous enabled item relative to activeId.

Overview

Next/previous enabled item relative to activeId. If activeId is itself disabled (or was disabled in place), movement starts from its position, so the neighbour in the requested direction is chosen rather than jumping to an end. Unknown/null ids start from the first (forward) or last (backward) enabled item.

Signature

function findRelativeItem<T extends CollectionItem>(items: readonly T[], activeId: string | null, direction: 1 | -1, options?: { wrap?: boolean; }): CollectionNavigationResult<T>
Parameter Type Optional Description
items readonly T[]
activeId string | null
direction 1 | -1
options { wrap?: boolean } Yes

Returns CollectionNavigationResult<T>