react / react/yoga

Flex shrink changes size with flex grow below 1

Open
#1,033 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Algorithm
Dominant language
C++
Stars
18.9k
Forks
1.6k
Avg merge
1m
Merged PRs (30d)
1

Description

Report

Issues and Steps to Reproduce

Take a single child smaller than its parent. Add flex grow between 0 and 1 (0.5 for instance). Try to set flex shrink to 0 or 1.

Expected Behavior

Same result with 0 or 1: flex shrink should have no impact on the child size since there is still unused space in the parent.

Actual Behavior

Not the same result.

Link to Code

http://tinyurl.com/yxosawoz

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and trace Yoga's flex layout handling for a single child with unused parent space, flex grow below 1, and flex shrink set to 0 or 1. Compare the computed child sizes and add or update a focused regression test; done means both shrink values produce the same size in this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.