-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[YogaKit] Removal of element messes up layout #606
Comments
Facing this issue, too. |
@emilsjolander I'm kinda stumped about this one... 1.{*wm: LAY_EXACTLY, hm: LAY_EXACTLY, aw: 414.000000 ah: 736.000000 initial This is the changes when you remove the violet button. Looks like the container isn't being remeasured. 1.}*wm: LAY_EXACTLY, hm: LAY_EXACTLY, d: (414.000000, 736.000000) initial |
Perhaps some dirty flag isn't being set correctly? However I would be very surprised if this is a bug in the C code and not the objc bindings as we aren't facing any similar issues on other platforms. |
@kovpas Does the behaviour change if you both call |
@woehrl01 Changing @emilsjolander even if I manually mark all the views as dirty it still doesn't change the layout. The curious bit is that this doesn't happen with React Native, which is using the same bindings, right? |
This is maybe also related to this issue #603, which is the reversed problem. Adding an element don't relayout its siblings. |
@woehrl01 no, as @tadeuzagallo said, nothing changes if I do @lucdion I saw #603... The reason I decided to fill a separate issue is that I don't really think it's related: In the case of #603, the view hierarchy remains the same, only yoga layout hierarchy is changed (by setting In my case, view hierarchy changes which leads to the messed up layout. |
So, this seems like a UIKit issue. If you set a breakpoint in YGLayout's That height of 90 + 40 padding (top and bottom, 20) explains the height of 130. It's unclear why UIView is returning 90 as a height. But it makes it clear that it isn't a yoga problem. |
@dshahidehpour according to the documentation, this is intended behavior:
I think what happens is that when there's the violet label inside the red view, |
Any progress on getting this merged in? |
Summary: Fixes facebook#606. If there are no subviews in `UIView`, yoga assumes that `sizeThatFits:` returns `CGSizeZero`. However, according to [the documentation](https://developer.apple.com/documentation/uikit/uiview/1622625-sizethatfits), `UIView` returns current size if there are no subviews. This diff adds a check - if there are no subviews, `sizeThatFits:` doesn't get called, and CGSizeZero is returned. Pull Request resolved: facebook#610 Reviewed By: davidaurelio Differential Revision: D6807406 Pulled By: priteshrnandgaonkar fbshipit-source-id: 9189cf14c393f840122bc365d3827881bf03548c
Report
Issues and Steps to Reproduce
Expected Behavior
State 3 should look exactly like state 1
Actual Behavior
The layout of the state 3 gets messed up. Looks like yoga thinks that the label is still there, also padding gets added twice to the height of the red view.
Link to Code
Demo project is here
The text was updated successfully, but these errors were encountered: