From 35efa43b88362676bf6e3bd5b5d5045387aa3c22 Mon Sep 17 00:00:00 2001 From: Alessio Gravili Date: Mon, 3 Jun 2024 07:33:17 -0400 Subject: [PATCH] [lexical-react] Bug Fix: checklist cannot be toggled in sub-editors (#6216) Co-authored-by: sahejkm --- packages/lexical-react/src/LexicalCheckListPlugin.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/lexical-react/src/LexicalCheckListPlugin.tsx b/packages/lexical-react/src/LexicalCheckListPlugin.tsx index 50bffdbc033..a76288bd77d 100644 --- a/packages/lexical-react/src/LexicalCheckListPlugin.tsx +++ b/packages/lexical-react/src/LexicalCheckListPlugin.tsx @@ -215,6 +215,7 @@ function handleClick(event: Event) { }); } }); + event.stopPropagation(); // Prevents potential parent-editor listeners from firing, causing the checkbox toggle to be undone } function handlePointerDown(event: PointerEvent) { @@ -222,6 +223,7 @@ function handlePointerDown(event: PointerEvent) { // Prevents caret moving when clicking on check mark event.preventDefault(); }); + event.stopPropagation(); } function findEditor(target: Node) {