1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Lexical: Merged list nodes

This commit is contained in:
Dan Brown
2024-12-03 19:03:52 +00:00
parent 36a4d79120
commit ebd4604f21
10 changed files with 111 additions and 492 deletions

View File

@@ -1,5 +1,5 @@
import {$getNearestNodeFromDOMNode, LexicalEditor} from "lexical";
import {$isCustomListItemNode} from "../../../nodes/custom-list-item";
import {$isListItemNode} from "@lexical/list";
class TaskListHandler {
protected editorContainer: HTMLElement;
@@ -38,7 +38,7 @@ class TaskListHandler {
this.editor.update(() => {
const node = $getNearestNodeFromDOMNode(listItem);
if ($isCustomListItemNode(node)) {
if ($isListItemNode(node)) {
node.setChecked(!node.getChecked());
}
});