diff --git a/dist/ReactFlow.esm.js b/dist/ReactFlow.esm.js index 993926b68..ca0b19a4f 100644 --- a/dist/ReactFlow.esm.js +++ b/dist/ReactFlow.esm.js @@ -10007,7 +10007,7 @@ var useZoomPanHelper = function useZoomPanHelper() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { height: 0, width: 0, - nodes: [], + nodes: store.getState().nodes, padding: DEFAULT_PADDING, includeHiddenNodes: false }; diff --git a/dist/ReactFlow.js b/dist/ReactFlow.js index fb6c9208c..d5c4e9cb4 100644 --- a/dist/ReactFlow.js +++ b/dist/ReactFlow.js @@ -10036,7 +10036,7 @@ var useZoomPanHelper = function useZoomPanHelper() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { height: 0, width: 0, - nodes: [], + nodes: store.getState().nodes, padding: DEFAULT_PADDING, includeHiddenNodes: false }; diff --git a/dist/nocss/ReactFlow-nocss.esm.js b/dist/nocss/ReactFlow-nocss.esm.js index b74d2e7ed..dd303d398 100644 --- a/dist/nocss/ReactFlow-nocss.esm.js +++ b/dist/nocss/ReactFlow-nocss.esm.js @@ -10007,7 +10007,7 @@ var useZoomPanHelper = function useZoomPanHelper() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { height: 0, width: 0, - nodes: [], + nodes: store.getState().nodes, padding: DEFAULT_PADDING, includeHiddenNodes: false }; diff --git a/dist/nocss/ReactFlow-nocss.js b/dist/nocss/ReactFlow-nocss.js index 3fbe5d6fb..27f94e256 100644 --- a/dist/nocss/ReactFlow-nocss.js +++ b/dist/nocss/ReactFlow-nocss.js @@ -10036,7 +10036,7 @@ var useZoomPanHelper = function useZoomPanHelper() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { height: 0, width: 0, - nodes: [], + nodes: store.getState().nodes, padding: DEFAULT_PADDING, includeHiddenNodes: false }; diff --git a/src/hooks/useZoomPanHelper.ts b/src/hooks/useZoomPanHelper.ts index 4de2f128e..3c0da37ac 100644 --- a/src/hooks/useZoomPanHelper.ts +++ b/src/hooks/useZoomPanHelper.ts @@ -55,7 +55,7 @@ const useZoomPanHelper = (): ZoomPanHelperFunctions => { d3Zoom.transform(d3Selection, transform); }, - fitViewToDimensions: (options: FitViewToDimensionsParams = { height: 0, width: 0, nodes: [], padding: DEFAULT_PADDING, includeHiddenNodes: false }) => { + fitViewToDimensions: (options: FitViewToDimensionsParams = { height: 0, width: 0, nodes: store.getState().nodes, padding: DEFAULT_PADDING, includeHiddenNodes: false }) => { const { minZoom, maxZoom } = store.getState(); if (!options.nodes.length) {