SINGLE_OPEN_STRATEGY
const
Overlay & Positioning
Nested-open strategy that enforces a single-open-at-a-time policy: opening a node closes any previously open sibling, while parents of the newly opened node are kept open. The `select` hook is a no-op (returns null). Used as the default strategy for ExpansionPanel.
TypeScript
Definition
The TypeScript definition as found in the origam source. Click the copy icon to copy the snippet.
Entries
Values
All entries in this constant. Click a value to copy it to clipboard.
- open: ({id, value, opened, parents}) => { if (value) { const newOpened = new Set<unknown>() newOpened.add(id) let parent = parents.get(id) while (parent != null) { newOpened.add(parent) parent = parents.get(parent) } return newOpened } else { opened.delete(id) return opened } }
- select: () => null
Ecosystem
Used by
Composables and components that consume this constant.
useNested
OrigamExpansionPanel
Usage
Examples
Ready-to-paste code snippets using this constant.
Passing the strategy to an OrigamExpansionPanels