Auto cross axis margins are ignored in wrapping containers and baseline rows
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 56/100
Línea de trabajo
Start in CalculateLayout.cpp at STEP 8, which the report identifies as overwriting cross-axis positions set by STEP 7 when items have auto margins. Read the related Flexbox steps cited in the issue and compare the reported wrap and baseline cases. Add the described cases as gentest fixtures and verify their cross positions and sizes match the expected values.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Report
- I have searched existing issues and this is not a duplicate
Issues and Steps to Reproduce
With flexWrap: 'wrap' or 'wrap-reverse', or in a row where any item uses baseline alignment, cross axis auto margins are ignored.
Take a row 200 wide with children 50x50 and 50x10, the second with marginTop: 'auto', and read the second child's top under each alignItems. For the baseline column there is no wrap and the first child has alignSelf: 'baseline'.
Expected Behavior
Top 40 in every case, as without wrap. Following CSS Flexbox 1 (9.4 steps 8 and 11, 9.6 steps 13 and 14), auto margins take the line's free space, and such an item is not stretched, baseline aligned or aligned by align-self.
Actual Behavior
alignItems |
no wrap | wrap | baseline | expected |
|---|---|---|---|---|
flex-start |
40 | 0 | 0 | 40 |
center |
40 | 20 | 20 | 40 |
flex-end |
40 | 40 | 40 | 40 |
stretch |
40 | 0 | 0 | 40 |
With wrap, marginBottom: 'auto' or both margins auto give the same column (expected 0 and 20), and under stretch a second child with no height gets top 0 and height 50 (expected top 50, height 0). alignItems: 'baseline' with marginBottom: 'auto' gives 40 (expected 0). YGErrataAll and YGErrataNone agree.
The cause is STEP 8 in CalculateLayout.cpp, which runs in both cases. It sets each item's cross position from its alignment with auto margins as 0, overwriting STEP 7's offset. Found in #2045.
Link to Code
The trees above use only the public C API, and I can add them as gentest fixtures with a fix.
- Lenguaje dominante
- C++
- Estrellas
- 18.9k
- Forks
- 1.6k
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de react/yoga
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Measured nodes in a cached subtree grow by a rounding step on every layout passPosiblemente ocupada @salmanmkc la tomó hace 6 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
react/yoga#2027 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Stale computedFlexBasis is reused across layouts: a flex: 1 node keeps its previous size after relayout at a new root sizePosiblemente ocupada @mozzius la tomó hace 64 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de react/yoga
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
eic/TimeframeBuilder#102 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AcademySoftwareFoundation/OpenImageIO#5662 ·
Los mantenedores suelen responder en 2 días
-
python
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
OpenChemistry/avogadrolibs#3295 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Tracktion/tracktion_engine#482 ·
Los mantenedores suelen responder en 1 día