Function toggleDetails
- toggle
Details (details, opts?): ActionReturn Parameters
- details: HTMLDetailsElement
The details element.
Optional
opts: {
animate?: boolean;
clickActive?: boolean;
store: MinimalWritable<boolean>;
}Options parameters.
Optional
animate?: booleanWhen true animate close / open state with WAAPI.
Optional
clickActive ?: booleanWhen false click events are not handled.
store: MinimalWritable<boolean>
A minimal writable boolean store.
Returns ActionReturn
Lifecycle functions.
- details: HTMLDetailsElement
Provides a toggle action for
details
HTML elements. The boolean store when provided controls open / closed state. Animation is accomplished using WAAPI controlling the height of the details element. It should be noted that this animation may cause layout thrashing (reflows) depending on the amount of DOM elements on the page though this doesn't occur under most situations. Animation can be toggled on / off with theanimate
option.It is not necessary to bind the store to the
open
attribute of the associated details element.When the action is triggered to close the details element a data attribute
closing
is set totrue
. This allows any associated closing transitions to start immediately.