taffy
                                
                                 taffy copied to clipboard
                                
                                    taffy copied to clipboard
                            
                            
                            
                        Flexbox won't shrink after removing all children
taffy version
0.8.0
Platform
Linux
What you did
- Created a flexbox with mostly default parameters in column configuration; size.w = 100%, size.h = auto. No min or max size specified.
- Populated it with nodes that take up space.
- Computed layout.
- Removed all of the children.
- Computed layout again.
What went wrong
I expected that the flexbox would shrink back to minimum size. Instead, it stayed the same size as if it still had items in it.
The expected result will actually occur if, after removing all children but before recomputing, you add a new child node which takes up no space.
Additional information
Before removing children:
Incorrect result:
Correct result (added a fake child node:)
If I had to guess there's probably a check somewhere that will refuse to recompute an area if there's no children to save time.
I can provide additional info about my setup if needed.