From e77049652402323a2ba23b417842e44155af86e3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 27 Nov 2023 13:11:24 +0100 Subject: [PATCH] fix(editor): don't check parent checkbox when child label was clicked --- src/components/input/editor/TipTap.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/input/editor/TipTap.vue b/src/components/input/editor/TipTap.vue index 8dc4d0442..35021a398 100644 --- a/src/components/input/editor/TipTap.vue +++ b/src/components/input/editor/TipTap.vue @@ -546,7 +546,12 @@ function setFocusToEditor(event) { } function clickTasklistCheckbox(event) { - // Needs to be a separate function to be able to remove the event listener + event.stopImmediatePropagation() + + if (event.target.localName !== 'p') { + return + } + event.target.parentNode.parentNode.firstChild.click() } @@ -558,6 +563,7 @@ watch( if (typeof checkboxes === 'undefined' || checkboxes.length === 0) { return } + if (editing) { checkboxes.forEach(check => { if (check.children.length < 2) { @@ -571,6 +577,7 @@ watch( return } + checkboxes.forEach(check => { if (check.children.length < 2) { return