facebook / SoLoader

Native code loader for Android
Apache License 2.0
1.34k stars 175 forks source link

YogaLayout does not recalculate its dimension for any runtime change in children dimension #109

Closed SanthoshKandalu closed 1 year ago

SanthoshKandalu commented 2 years ago

Hi team,

We are facing a major issue with using YogaLayout android.

Issue: Whenever the dimension of the child of YogaLayout changes dynamically, then the YogaLayout never recalculates its dimension for the change in child's dimension. For.eg. Let us say we have a YogaLayout (with height/width = WRAP_CONTENT) has two children with ImageView (height/width = WRAP_CONTENT) and TextView (height/width = WRAP_CONTENT) in flex direction = Column. And we download the image from a url and load into the image view, when image is downloaded, then ImageView dimension changes, but the parent YogaLayout never adjusts its height and it renders the children in previously calculated height, as a result, the bottom text view gets cropped off.

I tried to mark the yogaNode of ImageView as dirty to re-render but no luck.

This issue has been haunting us for long time, and this is limits us to use YogaLayout as child of RecyclerView.

Please help

simpleton commented 1 year ago

It's better to fill the issue in https://github.com/facebook/yoga