aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/util/DocumentManager.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 1a38e9aff..c670d0ab8 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -270,9 +270,9 @@ export class DocumentManager {
});
docContextPath.shift();
- const childViewIterator = async () => {
+ const childViewIterator = async (docView: DocumentView) => {
const innerDoc = docContextPath.shift();
- return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.unrendered ? (await rootContextView.ComponentView?.getView?.(innerDoc)) ?? this.getDocumentView(innerDoc) : undefined };
+ return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.unrendered ? (await docView.ComponentView?.getView?.(innerDoc)) ?? this.getDocumentView(innerDoc) : undefined };
};
const target = await this.focusViewsInPath(rootContextView, options, childViewIterator);
this.restoreDocView(target.viewSpec, target.docView, options, target.contextView ?? target.docView, targetDoc);
@@ -280,12 +280,12 @@ export class DocumentManager {
finished?.();
};
- focusViewsInPath = async (docView: DocumentView, options: DocFocusOptions, iterator: () => Promise<{ viewSpec: Opt<Doc>; childDocView: Opt<DocumentView> }>) => {
+ focusViewsInPath = async (docView: DocumentView, options: DocFocusOptions, iterator: (docView: DocumentView) => Promise<{ viewSpec: Opt<Doc>; childDocView: Opt<DocumentView> }>) => {
let contextView: DocumentView | undefined; // view containing context that contains target
while (true) {
docView.rootDoc.layoutKey === 'layout_icon' ? await new Promise<void>(res => docView.iconify(res)) : undefined;
docView.props.focus(docView.rootDoc, options); // focus the view within its container
- const { childDocView, viewSpec } = await iterator();
+ const { childDocView, viewSpec } = await iterator(docView);
if (!childDocView) return { viewSpec: viewSpec ?? docView.rootDoc, docView, contextView };
contextView = docView;
docView = childDocView;