LIST_OPEN_STRATEGY

const
Navigation & Disclosure

Open strategy for list-style navigation (e.g. OrigamList). Uses MULTIPLE_OPEN_STRATEGY for opening and a custom select handler that closes all siblings not on the path from the selected item to the root.

TypeScript

Definition

The TypeScript definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

Entries

Values

All entries in this constant. Click a value to copy it to clipboard.

open: MULTIPLE_OPEN_STRATEGY.open
select: ({id, value, opened, parents}) => { if (!value) return opened const path: Array<unknown> = [] let parent = parents.get(id) while (parent != null) { path.push(parent) parent = parents.get(parent) } return new Set(path) }

Ecosystem

Used by

Composables and components that consume this constant.

  • OrigamList

Usage

Examples

Ready-to-paste code snippets using this constant.

Providing LIST_OPEN_STRATEGY to a nested list

typescript