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

bug: Crash if width is a float #3

Closed
trickypr opened this issue Aug 30, 2022 · 1 comment
Closed

bug: Crash if width is a float #3

trickypr opened this issue Aug 30, 2022 · 1 comment
Assignees
Labels
bug 😔 Something isn't working

Comments

@trickypr
Copy link
Contributor

Reproduce

  1. Set the width to be a floating percentage (e.g. 23.5%)
  2. Run
  3. Crash

Error

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', /Users/school/.cargo/git/checkouts/dioxus-skia-2d7a6bc51af8408d/c27f004/state/src/node.rs:112:84
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/school/.cargo/git/checkouts/dioxus-skia-2d7a6bc51af8408d/c27f004/renderer/src/lib.rs:501:30

Code

cx.render(rsx! {
        view {
            height: "32",
            width: "auto",
            padding: "16",
            onscroll: onscroll,
            view {
                width: "23.5%",
                height: "stretch",
                background: "blue",
            }
        }
    })
trickypr added a commit to trickypr/carpet that referenced this issue Aug 30, 2022
@marc2332 marc2332 self-assigned this Sep 1, 2022
@marc2332 marc2332 added the enhancement 🔥 New feature or request label Sep 1, 2022
@marc2332 marc2332 changed the title Crash if width is a float bug: Crash if width is a float Sep 1, 2022
@marc2332 marc2332 added bug 😔 Something isn't working and removed enhancement 🔥 New feature or request labels Sep 1, 2022
@marc2332
Copy link
Owner

marc2332 commented Sep 3, 2022

This should have been fixed by 9c2f1c2 😄

You can now use floats or integers in all numeric attributes (height, width, padding)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 😔 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants