[YogaKit] Views originaly excluded from layout and later added are not correctly displayed #603
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Report
Using YogaKit, if a view is originally excluded from layout and later added, the layout is not correctly computed. I've modified the YogaKitSample app to demonstrate this issue: https://github.com/luc-dion/yoga/pull/1
Issues and Steps to Reproduce
Replaces this with steps to repro your issue.
Before the initial applyLayout(), if a view is first excluded from the layout, and then later included, the computed layout is not correctly updated. The newly included view is not displayed.
Expected Behavior
Describe what you expected would happen.

The new included view should be visible, as in this screenshot
Actual Behavior
Describe what actually happened.

The new included view should be visible. Instead this is the obtained result:
Link to Code
https://github.com/luc-dion/yoga/pull/1
Hello,
I've found similar problem. My view (YogaKit) is included in layout. Later I wish to remove it and recalculate all items. I do isIncludedInLayout=false, then applyLayout to root element, but this causes no layout changes, excluded view doesn't disappear
What method is right if I want to recalculate layouts excluding some of items?
Setting
isIncludedInLayout=false
isn't invalidating the internals of the yoganode (could be a bug). But what you should be able to use, to get a similar behavior isdisplay: none
.You are right! There is display property and it works good. Thank you!
@LeoSchleicher you're problem is different. In the case of this issue, if the view is initially displayed and later hidden, it works perfectly, but if the view is initially hidden and later shown, the view is not layouted.
I think it layouted, but invisible, since in first pass red block becomes full width and keeps it by second pass. I've seen already something alike, as I tried to build tabs layout
@dshahidehpour why did you close this issue, this issue is still relevant? The case of @LeoSchleicher was not related to this issue.
Since it's not related to this issue, I'd rather we reopen a new issue that has a repro.
@dshahidehpour but the issue report is still relevant, only comments from LeoSchleicher are not related.
The repro are available, they are on the specified branch https://github.com/luc-dion/yoga/pull/1
So why should we close this one and create another identical issue?
Thanks
Ah, thanks for clarifying, @luc-dion!
We are deprecating YogaKit as part of the Yoga 2.0 release. We are still going to release a new revision based on the current state of the repo, but won't be accepting new contributions, since we are going to be removing it from the repo after.