a map of observers for optgroup child nodes
a map of all
a map of all
disable the element, make it inaccessible
hide the label visually, only provide to aria
the label for the element, useful for display as well as screen readers
Returns a promise which resolves after the element next renders.
The promise resolves to true
if the element rendered and false
if the
element did not render.
This is useful when users (e.g. tests) need to react to the rendered state
of the element after a change is made.
This can also be useful in event handlers if it is desireable to wait
to send an event until after rendering. If possible implement the
_didRender
method to directly respond to rendering within the
rendering lifecycle.
a keyboard shortcut to access the element
Add an
Add a selectable node
an HTMLElement that has a 'selected' property
Renders the given lit-html template result
into the given node
.
Implement to customize the way rendering is applied. This is should not
typically be needed and is provided for advanced use cases.
lit-html
template result to render
node into which to render
Implement to customize where the element's template is rendered by
returning an element into which to render. By default this creates
a shadowRoot for the element. To render into the element's childNodes,
return this
.
Returns a node into which to render.
Called after element DOM has been rendered. Implement to
directly control rendered DOM. Typically this is not needed as lit-html
can be used in the _render
method to set properties, attributes, and
event listeners. However, it is sometimes useful for calling methods on
rendered elements, like calling focus()
on an element to focus it.
Current element properties
Changing element properties
Previous element properties
Called after the element DOM is rendered for the first time. Implement to perform tasks after first rendering like capturing a reference to a static node which must be directly manipulated. This should not be commonly needed. For tasks which should be performed before first render, use the element constructor.
The handler for when nodes are added or removed from the
the description of added and removed nodes in the last change
Override which provides tracking of invalidated state.
Override which returns the value of _shouldRender
which users
should implement to control rendering. If this method returns false,
_propertiesChanged will not be called and no rendering will occur even
if property values change or requestRender
is called.
Current element properties
Changing element properties
Previous element properties
Default implementation always returns true.
Override which warns when a user attempts to change a property during the rendering lifecycle. This is an anti-pattern and should be avoided.
Implement to control if rendering should occur when property values
change or requestRender
is called. By default, this method always
returns true, but this can be customized as an optimization to avoid
rendering work when changes occur which should not be rendered.
Current element properties
Changing element properties
Previous element properties
Default implementation always returns true.
Override which sets up element rendering by calling* _createRoot
and _firstRendered
.
Call to request the element to asynchronously re-render regardless of whether or not any property changes are pending.
Select an element to change the active item.
the node that is to be the selected element
<acc-select>
element is similar to a<select>
element with built-in labelling and aria attributes.<acc-select label="Instruments"> <acc-optgroup label="Strings"> <acc-item label="guitar"></acc-item> <acc-item label="cello"></acc-item> </acc-optgroup> <acc-optgroup label="percussion"> <acc-item label="drums"></acc-item> <acc-item label="tamborine"></acc-item> </acc-optgroup> </acc-select>