diff --git a/.changeset/tender-cobras-walk.md b/.changeset/tender-cobras-walk.md new file mode 100644 index 0000000..6e1d9bd --- /dev/null +++ b/.changeset/tender-cobras-walk.md @@ -0,0 +1,5 @@ +--- +"slate-angular": patch +--- + +update NODE_TO_INDEX and NODE_TO_PARENT when diffResult is undefined diff --git a/packages/src/view/render/list-render.ts b/packages/src/view/render/list-render.ts index 269ad8a..5d0dd19 100644 --- a/packages/src/view/render/list-render.ts +++ b/packages/src/view/render/list-render.ts @@ -155,6 +155,8 @@ export class ListRender { } else { const newContexts = []; this.children.forEach((child, index) => { + NODE_TO_INDEX.set(child, index); + NODE_TO_PARENT.set(child, parent); let context = getContext(index, child, parentPath, childrenContext, this.viewContext); const previousContext = this.contexts[index]; if (memoizedContext(this.viewContext, child, previousContext as any, context as any)) { @@ -261,7 +263,7 @@ export function getCommonContext( return { selection: null, decorations: ds }; } } catch (error) { - this.options.viewContext.editor.onError({ + viewContext.editor.onError({ code: SlateErrorCode.GetStartPointError, nativeError: error });