[YogaKit] Views originaly excluded from layout and later added are not correctly displayed #603

Closed
opened 2017-07-17 06:15:40 -07:00 by lucdion · 10 comments
lucdion commented 2017-07-17 06:15:40 -07:00 (Migrated from github.com)

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
simulator screen shot jul 17 2017 9 01 52 am

Actual Behavior

Describe what actually happened.
The new included view should be visible. Instead this is the obtained result:
simulator screen shot jul 17 2017 9 01 11 am

Link to Code

https://github.com/luc-dion/yoga/pull/1

# 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 - [X] I have searched [existing issues](https://github.com/facebook/yoga/issues) and this is not a duplicate # 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 ![simulator screen shot jul 17 2017 9 01 52 am](https://user-images.githubusercontent.com/14981341/28269070-af2c2d84-6ace-11e7-8804-4e058b3b5420.png) # Actual Behavior ***Describe what actually happened.*** The new included view should be visible. Instead this is the obtained result: ![simulator screen shot jul 17 2017 9 01 11 am](https://user-images.githubusercontent.com/14981341/28269078-b5ac538c-6ace-11e7-8651-480336ea4a0a.png) # Link to Code https://github.com/luc-dion/yoga/pull/1
LeoSchleicher commented 2017-07-18 01:13:44 -07:00 (Migrated from github.com)

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?

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?
woehrl01 commented 2017-07-18 03:05:16 -07:00 (Migrated from github.com)

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 is display: none.

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 is `display: none`.
LeoSchleicher commented 2017-07-18 03:09:46 -07:00 (Migrated from github.com)

You are right! There is display property and it works good. Thank you!

You are right! There is display property and it works good. Thank you!
lucdion commented 2017-07-18 05:34:27 -07:00 (Migrated from github.com)

@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.

@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.
LeoSchleicher commented 2017-07-18 05:38:39 -07:00 (Migrated from github.com)

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

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
lucdion commented 2017-07-26 07:07:20 -07:00 (Migrated from github.com)

@dshahidehpour why did you close this issue, this issue is still relevant? The case of @LeoSchleicher was not related to this issue.

@dshahidehpour why did you close this issue, this issue is still relevant? The case of @LeoSchleicher was not related to this issue.
d16r commented 2017-07-26 07:11:25 -07:00 (Migrated from github.com)

Since it's not related to this issue, I'd rather we reopen a new issue that has a repro.

Since it's not related to this issue, I'd rather we reopen a new issue that has a repro.
lucdion commented 2017-07-26 07:21:35 -07:00 (Migrated from github.com)

@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

@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
d16r commented 2017-07-26 10:37:01 -07:00 (Migrated from github.com)

Ah, thanks for clarifying, @luc-dion!

Ah, thanks for clarifying, @luc-dion!
NickGerleman commented 2023-06-13 08:04:36 -07:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#603
No description provided.