Skip to content

Commit

Permalink
[lexical-react] Bug Fix: checklist cannot be toggled in sub-editors (#…
Browse files Browse the repository at this point in the history
…6216)

Co-authored-by: sahejkm <sahejk@meta.com>
  • Loading branch information
AlessioGr and Sahejkm authored Jun 3, 2024
1 parent 10c687d commit 35efa43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/lexical-react/src/LexicalCheckListPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,15 @@ function handleClick(event: Event) {
});
}
});
event.stopPropagation(); // Prevents potential parent-editor listeners from firing, causing the checkbox toggle to be undone
}

function handlePointerDown(event: PointerEvent) {
handleCheckItemEvent(event, () => {
// Prevents caret moving when clicking on check mark
event.preventDefault();
});
event.stopPropagation();
}

function findEditor(target: Node) {
Expand Down

0 comments on commit 35efa43

Please sign in to comment.