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

the Layout component in hydrogen-may shows up with the wrong size, until it is focused, then its displayed size changes #5856

Closed
balazsbajorics opened this issue Jun 6, 2024 · 2 comments · Fixed by #6114
Assignees
Labels
Canvas Affects the visual editor Severe Urgent, serious, or fatal errors

Comments

@balazsbajorics
Copy link
Contributor

balazsbajorics commented Jun 6, 2024

This is a problem in how we measure the size of unfocused and focused components which wrap their children in a thick layer of wrapper elements.

It is particularly problematic in the sample project, because it always shows up, and looks clearly incorrect because the outline visibly does not line up with what's rendered on the screen.

@maltenuhn maltenuhn added Canvas Affects the visual editor Severe Urgent, serious, or fatal errors labels Jun 10, 2024
@seanparsons seanparsons self-assigned this Jun 11, 2024
@seanparsons
Copy link
Contributor

Mitigation for the issue added to the project here: concrete-utopia/hydrogen-editions-24#11

@seanparsons
Copy link
Contributor

seanparsons commented Jun 13, 2024

Diagnosis of the cause:

  • It's defined with an Outlet as a child, which inside the component itself goes inside a fragment that makes up the return and inside that in a main element.
  • That means we statically identify the Outlet as a child, which then accounts for its size when unfocused.
  • However when we focus it, all the actual contents then get added into the metadata.
  • When focused, by the power of recursion (and for the sake of simplicity putting to the side some inconsequential elements) the size for Layout ends up being effectively the size of the Outlet and the size of the Footer.

image

The outcome is that this possibly needs some time spent in the DOM walker, which we shouldn't do right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canvas Affects the visual editor Severe Urgent, serious, or fatal errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants