diff --git a/plugins/tasklist/src/checkbox/index.ts b/plugins/tasklist/src/checkbox/index.ts index 73061016..793781d8 100644 --- a/plugins/tasklist/src/checkbox/index.ts +++ b/plugins/tasklist/src/checkbox/index.ts @@ -65,7 +65,9 @@ class Checkbox extends Card { return !!this.#container?.hasClass(CHECKBOX_CHECKED_CLASS); }; - onClick = () => { + onClick = (event: MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); const checked = this.update(); this.setValue({ checked: !checked, @@ -92,11 +94,11 @@ class Checkbox extends Card { if (!isEngine(this.editor) || this.editor.readonly) { return; } - this.#container.on('click', this.onClick); + this.#container.on('mousedown', this.onClick); } destroy() { - this.#container?.off('click', this.onClick); + this.#container?.off('mousedown', this.onClick); } } export default Checkbox;