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

Inconsistent behaviour in multiple select #3185

Open
chungwong opened this issue Nov 7, 2024 · 2 comments
Open

Inconsistent behaviour in multiple select #3185

chungwong opened this issue Nov 7, 2024 · 2 comments
Labels
bug Something isn't working html Related to the html crate rsx Related to rsx or the dioxus-rsx crate

Comments

@chungwong
Copy link
Contributor

Problem

For some reasons, if the value of multiple is a boolean, then the behaviour is wrong, default selection should not happen.

Steps To Reproduce

fn app() -> Element {
    rsx! {
        select {
            multiple: "true",
            option { label: "Brand", value: "2" }
        }

        select {
            multiple: true,
            option { label: "Brand", value: "2" }
        }
    }

Screenshots

Screenshot from 2024-11-07 13-06-35

Environment:

  • Dioxus version: master
@chungwong chungwong changed the title inconsistent behaviour in multiple select Inconsistent behaviour in multiple select Nov 8, 2024
@chungwong
Copy link
Contributor Author

Just to add more context to the issue.
The followings behave the same. so the issue is something different.

select {
    multiple: true.to_string(),
}
select {
    multiple: if true { "true" } else { "false" },
}
select {
    multiple: true,
}

@matthunz matthunz added the rsx Related to rsx or the dioxus-rsx crate label Nov 11, 2024
@matthunz
Copy link
Contributor

matthunz commented Nov 11, 2024

Hmm strange ”true” is treated differently than ”true”.to_string() (or the other examples you gave) 🤔

That makes me think this is an issue for dynamic attributes in RSX, since string literals are handled differently as static attributes.

@matthunz matthunz added bug Something isn't working html Related to the html crate labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working html Related to the html crate rsx Related to rsx or the dioxus-rsx crate
Projects
None yet
Development

No branches or pull requests

2 participants