mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
editor: fix crash on removing task list
This commit is contained in:
@@ -39,7 +39,7 @@ export function TaskListComponent(
|
||||
const checked = stats.total > 0 && stats.total === stats.checked;
|
||||
|
||||
const isNested = useMemo(() => {
|
||||
if (!pos) return false;
|
||||
if (!pos || editor.state.doc.nodeSize < pos) return false;
|
||||
return editor.state.doc.resolve(pos).parent.type.name === TaskItem.name;
|
||||
}, [editor.state.doc, pos]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user