`proportions` in Container (`Rows` and `Columns`) do not work, if the component is added at a later stage
Closed this issue · 4 comments
Describe the bug
Container proportions for Rows and Columns are not functioning correctly. All the remaining space is left empty, and the children elements do not get the correct size (e.g., 1/3 of the available space), as demonstrated in the attached picture.
Expected Behavior:
Children should occupy the specified proportions of the available space (e.g., 1/3 each or homogeneous).
Actual Behavior:
All remaining space is left empty, and children elements do not occupy the correct size.
Steps to Reproduce
- Create a container with Rows or Columns.
- Set the
proportions="homogeneous"
parameter of e.g.Row
for the child elements. - Observe the layout in the browser.
Screenshots/Videos
![image](https://private-user-images.githubusercontent.com/41641225/346337887-56eee2ed-844b-488a-bd33-51f431fa4b88.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzMzk0MDcsIm5iZiI6MTcyMjMzOTEwNywicGF0aCI6Ii80MTY0MTIyNS8zNDYzMzc4ODctNTZlZWUyZWQtODQ0Yi00ODhhLWJkMzMtNTFmNDMxZmE0Yjg4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMwVDExMzE0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRlZTI3NmYzZDYxMzJhYTJiOGFhNzRlOTkyNWNjOWI1NzFiYzU3ZWUxYzJlZmQzMTNiOGI0MzQ1NTg3OWJkODMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Do7ry5dp1SqTGJiC4nbKycTBkzj7FDS-DHXKE1FnmYU)
Operating System
Windows, MacOS, Linux
What browsers are you seeing the problem on?
Chrome, Firefox, Safari, Edge, Opera, Internet Explorer
Browser version
No response
What device are you using?
No response
Additional context
No response
For anyone looking into this, they seem to work fine if the component is visible from the start. They don't work, if the component is added at a later stage
I'm not completely sure what the cause of this bug is, but I think ResizeObservers don't trigger on every change, which can lead to the calculated flex-grows being out-of-date. We've added a workaround with requestAnimationFrame
that solves the issue in most cases, but there will almost certainly be cases where this bug still occurs.
I'm closing this, since we haven't seen the issue pop up anymore. Feel free to re-open, should it emerge from the dead