Skip to content

Non-ASCII characters in input's value completely disable the onclick and onsubmit callbacks on desktop platform #3423

@Andrew15-5

Description

@Andrew15-5

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions