SelectableMixin

Tracks whether the element is currently selected

Overview

Purpose: Tracks whether the element is currently selected.

This mixin works in the middle of the Elix render pipeline:

events → methodssetState → render DOM → post-render

Provides the component with:

  • selected state member tracking whether the element is currently selected
  • selected public property exposing the above state
  • selectedchange 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.