Skip to content

Layout application changes views outside the Yoga tree #286

Description

@dajiaohuang

YGAttachNodesFromViewHierachy adds only subviews with isYogaEnabled && isIncludedInLayout to the Yoga node tree. However, YGApplyLayoutToViewHierarchy later iterates every UIKit subview and applies the subview's Yoga layout values before recursing, including views that were never attached or measured by Yoga. A plain subview that was not configured with .flex can therefore have its frame replaced with zero or undefined-derived geometry when its FlexLayout ancestor calls layout().

Reproduction: add a normal UIView or UILabel as a subview of a FlexLayout container without accessing its .flex property, give it a nonzero frame, then call the container's .flex.layout(). The non-Flex view should remain untouched because it is not part of the calculated Yoga tree.

Please apply layout only to views represented in the Yoga tree, while preserving the expected behavior for included FlexLayout descendants.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions