Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: label with auto width in a flex container get 0 width #1098

Open
Aiving opened this issue Feb 7, 2025 · 0 comments
Open

Issue: label with auto width in a flex container get 0 width #1098

Aiving opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
bug 😔 Something isn't working layout 📐 Relate to layout
Milestone

Comments

@Aiving
Copy link
Contributor

Aiving commented Feb 7, 2025

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",
                }
            }
        }
    }
}
@marc2332 marc2332 changed the title Auto-sized flex Issue: label with auto width in a flex container get 0 width Feb 7, 2025
@marc2332 marc2332 added bug 😔 Something isn't working layout 📐 Relate to layout labels Feb 7, 2025
@marc2332 marc2332 self-assigned this Feb 7, 2025
@marc2332 marc2332 moved this to Todo in Freya Planning Feb 7, 2025
@marc2332 marc2332 added this to the 0.3.0 milestone Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 😔 Something isn't working layout 📐 Relate to layout
Projects
Status: Todo
Development

No branches or pull requests

2 participants