Skip to content

Navigation Menu

Sign in
Sign up

calculateBaseline(node) may return NaN if the baselineChild has not been measured #1932

Open

Description

Demo JSX Code:

<Layout config={{useWebDefaults: false}}>
 <Node style={{flexDirection: 'column'}}>
 <Node style={{flexDirection: 'row', width: 200, padding: 10, alignItems:'baseline'}}>
 <Node style={{ flexDirection: 'row', width: 100, height:100}}>
 <Node />
 </Node>
 </Node>
 </Node>
</Layout>

the yoga layout result : ⚠️⚠️⚠️the alignItems:'baseline' node got wrong lineHeight value of 0 ⚠️⚠️⚠️

Image

in constrast, Chrome/Safari perform well as expected

Image

this bug may resulting from wrong value returned by float calculateBaseline(const yoga::Node* node), if the baselineChild has not been measured, node->getLayout().measuredDimension(Dimension::Height) will return NaN value

Image

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

      AltStyle によって変換されたページ (->オリジナル) /