Skip to content

bug: auto-sized labels inside a flex container with non-start cross_align, causes misalignment in the cross axis #1098

@Aiving

Description

@Aiving

When content: "flex" is used in an auto-sized label, the sizes of child elements using the flex(grow_factor) function start measuring their size incorrectly.

Code for reproduction:

use freya::prelude::*;

fn main() {
    launch(App);
}

#[component]
fn App() -> Element {
    rsx! {
        rect {
            width: "256",
            height: "48",
            padding: "12 5 12 5",
            background: "#999999",

            rect {
                direction: "horizontal",
                spacing: "8",
                cross_align: "center",
                content: "flex",

                rect {
                    width: "flex",
                    main_align: "center",

                    label { "Click Me!" }
                }

                rect {
                    width: "12",
                    height: "12",
                    background: "red",
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

Labels

bug 😔Something isn't workinglayout 📐Relate to layout

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions