mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Zoom in to node after creation (no-changelog) (#17617)
This commit is contained in:
@@ -862,6 +862,26 @@ watch([nodesSelectionActive, userSelectionRect], ([isActive, rect]) =>
|
||||
emit('update:has-range-selection', isActive || (rect?.width ?? 0) > 0 || (rect?.height ?? 0) > 0),
|
||||
);
|
||||
|
||||
watch([vueFlow.nodes, () => experimentalNdvStore.nodeNameToBeFocused], ([nodes, toFocusName]) => {
|
||||
const toFocusNode =
|
||||
toFocusName &&
|
||||
(nodes as Array<GraphNode<CanvasNodeData>>).find((n) => n.data.name === toFocusName);
|
||||
|
||||
if (!toFocusNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
// setTimeout() so that this happens after layout recalculation with the node to be focused
|
||||
setTimeout(() => {
|
||||
experimentalNdvStore.focusNode(toFocusNode, {
|
||||
collapseOthers: false,
|
||||
canvasViewport: viewport.value,
|
||||
canvasDimensions: dimensions.value,
|
||||
setCenter,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Provide
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user