Merge pull request #5258 from xyflow/fix/fit-view

Fix/fit view in SvelteFlow
This commit is contained in:
Peter Kogo
2025-05-14 17:47:35 +02:00
committed by GitHub
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/svelte': patch
---
Fix fitView not working when accessed through the SvelteFlowProvider
@@ -385,7 +385,9 @@ export function useSvelteFlow<NodeType extends Node = Node, EdgeType extends Edg
return Promise.resolve(true); return Promise.resolve(true);
}, },
fitView: store.fitView, fitView: (options?: FitViewOptions) => {
return store.fitView(options);
},
fitBounds: async (bounds: Rect, options?: FitBoundsOptions) => { fitBounds: async (bounds: Rect, options?: FitBoundsOptions) => {
if (!store.panZoom) { if (!store.panZoom) {
return Promise.resolve(false); return Promise.resolve(false);