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

Non-ASCII characters in input { type: "button", value: "here" } disable the onclick callback on desktop platform #3423

Open
Andrew15-5 opened this issue Dec 21, 2024 · 0 comments

Comments

@Andrew15-5
Copy link
Contributor

Problem

Clicking on the button (in v0.6.1) in the desktop app doesn't produce any logs, but does work in web:

use dioxus::{logger::tracing::info, prelude::*};

fn main() {
    dioxus::launch(App);
}

#[component]
fn App() -> Element {
    rsx! {
        style {
            r#"
            body {{
              background-color: #0f1116;
              color: #ffffff;
              height: 100vh;
              display: flex;
              align-items: center;
              justify-content: center;
            }}
            "#
        }
        input {
            type: "button",
            value: "click me!",
            onclick: move |_| async move {
                info!("clicked!");
            }
        }
    }
}

So Unicode pictograms don't work, and Cyrillic letters as well. So I assume anything outside ASCII range will break the button.

I now tried button:

        button {
            type: "button", // Do we need this?
            onclick: move |_| async move {
                info!("clicked!");
            },
            "🗑click me!"
        }

and it does work. Thought if you don't need to put any content inside of it, I think you generally should avoid button, for some legacy/compatibility issues. So the issue stands either way.

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

I should see clicked! in the logs upon clicking on the button.

Screenshots

Environment:

  • Dioxus version: v0.6.1
  • Rust version: rustc 1.83.0-nightly (fb4aebddd 2024-09-30)
  • OS info: Pop!_OS 22.04
  • App platform: desktop

Questionnaire

I'm interested in fixing this myself but don't know where to start.
I don't have time to fix this right now, but maybe later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant