Overview
Purpose: Tracks whether the element is currently selected.
This mixin works in the middle of the Elix render pipeline:
events → methods ➞ setState → render DOM → post-render
Provides the component with:
selected
state member tracking whether the element is currently selectedselected
public property exposing the above stateselectedchange
event raised when the selected state changes
Usage
import SelectableMixin from "elix/src/base/SelectableMixin.js";
class MyElement extends SelectableMixin(HTMLElement) {}
API
Used by classes CalendarDay, CalendarDayButton, CheckListItem, MenuItem, Option, PlainCalendarDay, PlainCalendarDayButton, PlainChoice, PlainMenuItem, PlainPageDot, PlainSelectableButton, PlainTabButton, SelectableButton, and TabButton.
selected property
True if the element is currently selected.
Type: boolean
Default: false
selectedchange event
Raised when the selected
property changes.