MULTIPLE_OPEN_STRATEGY

const
Navigation & Disclosure

Open strategy that allows any number of nested items to be expanded simultaneously. When opening an item all its ancestors are also opened; when closing only the targeted item is removed from the opened set. Contrast with SINGLE_OPEN_STRATEGY which collapses siblings. Used by OrigamList, OrigamTreeview and any nested component.

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: ({id, value, opened, parents}) => { if (value) { let parent = parents.get(id) opened.add(id) while (parent != null && parent !== id) { opened.add(parent) parent = parents.get(parent) } return opened } else { opened.delete(id) } return opened }
select: () => null
Selection is not tracked by this strategy (returns null).

Ecosystem

Used by

Composables and components that consume this constant.

  • OrigamList

  • OrigamTreeview

Usage

Examples

Ready-to-paste code snippets using this constant.

Applying MULTIPLE_OPEN_STRATEGY to a list

typescript