We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cfbc4d2 commit 9d1f5faCopy full SHA for 9d1f5fa
packages/core/src/store/actions.ts
@@ -844,14 +844,18 @@ export function useActions(
844
setEdges(edges)
845
}
846
847
- if (viewport || position) {
+ if ((viewport?.x && viewport?.y) || position) {
848
+ const x = viewport?.x || position[0]
849
+ const y = viewport?.y || position[1]
850
+ const nextZoom = viewport?.zoom || zoom || state.viewport.zoom
851
+
852
until(() => viewportHelper.value.initialized)
853
.toBe(true)
854
.then(() => {
855
viewportHelper.value.setViewport({
- x: viewport.x || position[0],
- y: viewport.y || position[1],
- zoom: viewport.zoom || zoom || state.viewport.zoom,
856
+ x,
857
+ y,
858
+ zoom: nextZoom,
859
})
860
861
0 commit comments