Skip to content

Flexbox won't shrink after removing all children #830

Open
@marrub--

Description

@marrub--

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:
Image

Incorrect result:
Image

Correct result (added a fake child node:)
Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions