react / react/yoga

flex-wrap + position relative has no effect along main axis, unlike in chrome

Open
#1,856 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Image

very basic, when a parent has flex-wrap, relative positioning along the main axis has no effect. this behaviour isn't seen in chrome. the first element has offset top:10 left:10, but as you see it's only moved down and not right..
kinda shocked and annoyed no one has fixed this or brought this up

"<Layout config={{useWebDefaults: false}}>
<Node
style={{
width: 200,
height: 250,
padding: 10,
flexWrap: 'wrap',
}}>
<Node style={{margin: 5, height: 50, width: 50, left:10, top:10, position:'relative'}} />
<Node style={{margin: 5, height: 50, width: 50}} />
<Node style={{margin: 5, height: 50, width: 50}} />
<Node style={{margin: 5, height: 50, width: 50}} />

"

vs chrome

"<style>
.box {
width:50px;
height:50px;
display:flex;
margin:5px;
background-color:yellow;
left:50px;
top:50px;
position:relative;
}
</style>

"

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 by reproducing the provided Yoga layout example and compare its wrapped flex item positions with the supplied Chrome HTML example. Trace the flex-wrap and relative-positioning behavior, then verify that the first item moves along both axes without changing the expected placement of the other items.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.