Add toggle event and change when checked-change event is fired.
This commit is contained in:
@@ -90,7 +90,13 @@ class TpCheckbox extends Inert(ControlState(FormElement(LitElement))) {
|
||||
|
||||
toggle() {
|
||||
this.checked = !this.checked;
|
||||
this.dispatchEvent(new CustomEvent('checked-changed', { detail: this.checked, bubbles: true, composed: true }));
|
||||
this.dispatchEvent(new CustomEvent('toggled', { detail: this.checked, bubbles: true, composed: true }));
|
||||
}
|
||||
|
||||
updated(changes) {
|
||||
if (changes.has('checked')) {
|
||||
this.dispatchEvent(new CustomEvent('checked-changed', { detail: this.checked, bubbles: true, composed: true }));
|
||||
}
|
||||
}
|
||||
|
||||
get value() {
|
||||
|
Reference in New Issue
Block a user