Comments (3)
The playground example is giving a root node with explicit dimensions, then calculating layout with infinite free space available, so it makes sense it could give a different answer if this bug is specific to behavior on root node.
Interesting that the result is as if width and height were swapped when calculating inset percentage reference. We’ve had bugs before with getting confused on flex direction, which could maybe cause this.
@joevilches going to assign your way, since you worked on the absolute positioning code recently.
from yoga.
@robbert-ef thanks for the report! I was able to verify the problem and it seems to be a bit more general than you described. We get this issue when we have the following:
- Parent had different flex direction than child
- Child uses percents for some position (left, right, top, etc)
Neither the position type nor the fact that this is the root matters (actually, when we are not working on the root, absolute position will be correct). Your second example works because the nodes have the same flex direction. The "flex direction" of the root's owner is undefined, but the relevant code seems to assume "row" while the default flex-direction is column. Ill put up a fix here soon
from yoga.
The attached commit should fix the issue
from yoga.
Related Issues (20)
- [Yoga 3] Wrong outcome of max-height percentage value HOT 1
- [Yoga 3] Potential RTL paddingStart/paddingEnd bug HOT 4
- YGNodeFree does not mark parent as dirty HOT 1
- Measurement of absolute-positioned nodes
- Box percentage width calculation is different from the Web
- get/setDirection() bindings missing from Yoga npm version 3.0.4 HOT 2
- flexBasis+flexShrink+borderWidth result in an wrong value HOT 1
- 3.1.0 BUG: The change in the UILabel text affects the horizontal width calculation!!! HOT 2
- 0 layoutWidth and 0 layoutHeight after repeated layout calculation HOT 4
- [c++] YGNodeCalculateLayout() is not working on iOS/iPad with any optimization -O1, O2, O3, OFast (because of finite-math-only) HOT 4
- Child node size is wrong when layout is measured by parent HOT 2
- [c++]set the fex property 1 to the node with measueFunc , the node width will be 0 HOT 1
- Parent components ignore minHeight when parent's flexDirection is column
- SVG Antivirus reporting your website yogalayout.dev as blocked HOT 4
- YGNode zero size when combine flex-direction: column and flex-direction: row on a fifth block
- [JS] Using Yoga npm version 3.0.1 with Jest HOT 2
- Using percentages for layout does not correctly display the required space when there is a gap???
- What are some reasons `alignItems` may not work? HOT 1
- [Crash] - java.lang.NoClassDefFoundError: com.facebook.yoga.YogaNative
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yoga.