Attachable

The Attachable mixin enables elements to attach to and control other elements via the for attribute or parent relationship.

Properties

NameTypeDescription
htmlForStringThe ID of the control element to attach to. When set, the element attaches to the element with this ID.
currentControlHTMLElement | nullReference to the currently attached control element.
$controlHTMLElement | nullGetter/setter for the control element. If for attribute is set, finds element by ID. Otherwise uses parent element.

Methods

NameDescription
attach(control)Attach to a specific control element.
detach()Detach from the current control element.
setCurrentControl(control)Internal method to update the current control.
handleControlChange(prev, next)Hook method called when control changes. Override to handle control changes.