Merge pull request #5258 from xyflow/fix/fit-view
Fix/fit view in SvelteFlow
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user