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

Support updating a component's style attribute when possible or prevent updating full stop. #6124

Closed
seanparsons opened this issue Jul 25, 2024 · 0 comments · Fixed by #6165 · May be fixed by #6132
Closed

Support updating a component's style attribute when possible or prevent updating full stop. #6124

seanparsons opened this issue Jul 25, 2024 · 0 comments · Fixed by #6165 · May be fixed by #6132
Assignees

Comments

@seanparsons
Copy link
Contributor

seanparsons commented Jul 25, 2024

Taking this project as an example: https://utopia.pizza/p/1f34c834-brindle-output/

It should be possible to move and resize both MyCompDiv and MyCompFrag and have those update the style attribute in identical ways, so e.g. resizing both would result in:

      <MyCompDiv style={{ height: 20 }} />
      <MyCompFrag style={{ height: 20 }} />

This should be achieved by having getElementFragmentLikeType not return sizeless-div for components at all, so if there is a case where that would actually be incorrect then that needs to be flagged (though that would also likely be a separate issue to be dealt with later, and potentially via the component annotation API).

As well as that, the componentHonoursProps* functions only check that the root element uses those props, so that will need to be addressed (https://github.com/concrete-utopia/utopia/blob/master/editor/src/core/model/element-template-utils.ts#L876-L896), and the selective DOM walking doesn't reconstruct the frames, which will be required to show the selection outline update in real time during interactions.

@Rheeseyb Rheeseyb changed the title Support updating a component's inner style props when possible or prevent updating full stop. Support updating a component's style attribute when possible or prevent updating full stop. Jul 25, 2024
@seanparsons seanparsons self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant