Skip to content

[Bug] UI Flex: row wrap order differs from expected CSS flexbox behavior #1425

@manuelmaceira

Description

@manuelmaceira

Description

When rendering a DCL scene UI with flexDirection: 'row' and flexWrap: 'wrap', the button order within each row appears reversed compared to Unity's client.

Steps to reproduce

  1. Deploy a scene with a flex container using flexDirection: 'row', flexWrap: 'wrap'
  2. Add multiple child elements (e.g., 24 buttons sorted ascending)
  3. Compare the visual order between Unity and Godot clients

Expected behavior

Per CSS flexbox spec, flexDirection: 'row' with flexWrap: 'wrap' should lay out items left-to-right, wrapping to the next row below:

Image

Actual behavior

The Godot client renders the items in a different order per row compared to Unity. Both clients appear to diverge from the expected CSS flexbox behavior, but in different ways.

Image

Context

Discovered while testing a color/lighting comparison scene that has time-of-day buttons arranged in a wrapped row layout.

Related

This is a UI layout engine issue, not related to scene logic. The scene provides the elements in the correct ascending order. Whats weird is that unity displays it wrong and godot displays it as expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Planning

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions