Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using sub flows, fitView does not work correctly #2223

Closed
tommhuth opened this issue Jun 15, 2022 · 1 comment
Closed

When using sub flows, fitView does not work correctly #2223

tommhuth opened this issue Jun 15, 2022 · 1 comment
Assignees
Milestone

Comments

@tommhuth
Copy link

tommhuth commented Jun 15, 2022

Describe the Bug

Ever since upgrading to v10, i've noticed that fitView no longer worked correctly. Turns out the culprit is sub flows.

When using sub flows it looks like all nodes with a parentNode are ignored in the bounding box calculation, essentially centering the view on parentNodes only. If I drop sub flow (v9 style), the centering works as expected. If all your sub nodes are positioned within the natural bounding box of all parentNodes, the problem is not apparent, but moving sub nodes outside of this will essentially cut them off.

See the Codesandbox where one of the nodes have parentNode set and are position on top of parent, and then becomes cut off when centering the view.

Your Example Website or App

https://codesandbox.io/s/sandpack-project-forked-s87wqe?file=/initial-elements.js

Steps to Reproduce the Bug or Issue

  1. Add nodes, where some are sub flows
  2. Use fitView and notice how sub flow nodes are seemingly ignored

Expected behavior

Using sub flow should not mess up fitView (or getRectOfNodes)

Screenshots or Videos

No response

Platform

  • Macbook Pro
  • Chrome 102

Additional context

No response

@moklick moklick self-assigned this Jun 16, 2022
@moklick moklick modified the milestones: v10, 10.3.8 Jun 16, 2022
@moklick
Copy link
Member

moklick commented Jun 22, 2022

Thanks! Fixed in v10.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants