From 9983a488807f72c152d0c9164b218f9091c93a92 Mon Sep 17 00:00:00 2001 From: Peter Kaske Date: Tue, 5 Apr 2022 14:53:52 +0200 Subject: [PATCH] Fire event when checked state changes. --- package.json | 2 +- tp-checkbox.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c36cab..594a071 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tp/tp-checkbox", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "tp-checkbox.js", "scripts": { diff --git a/tp-checkbox.js b/tp-checkbox.js index b713dd6..e458169 100644 --- a/tp-checkbox.js +++ b/tp-checkbox.js @@ -90,6 +90,7 @@ 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 })); } get value() {