select the editing node when jump from edit subtree
This commit is contained in:
1 parent
734879a736
commit
c933541f3e
5 files changed
+27
-15
No files matched your search
@@ -660,7 +660,7 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
|
||||
const data = findSubtree(findDataById(editor.selectedId));
|
||||
if (data?.path) {
|
||||
const path = `${workspace.workdir}/${data.path}`;
|
||||
workspace.open(path);
|
||||
workspace.open(path, Number(editor.selectedId) - Number(data.id) + 1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1075,6 +1075,15 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
|
||||
editor.size.width = editorSize.width;
|
||||
editor.size.height = editorSize.height;
|
||||
}
|
||||
|
||||
if (typeof editor.editNode === "number") {
|
||||
const id = editor.editNode.toString();
|
||||
selectNode(null);
|
||||
setTimeout(() => {
|
||||
editor.graph.focusItem(id);
|
||||
selectNode(id);
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// check should subtree
|
||||
|
||||
Reference in new issue
Block a user