fix: Handle unicode in webview events. (#3386)

* Handle unicode in webview events.

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Tobias DomhanandJonathan Kelley authored and GitHub committed 2025-01-08 14:32:57 -08:00
1 parent 20cdafbf16
commit 6755accbdc
7 files changed
+60 -18

No files matched your search

+27
View File
@@ -48,6 +48,7 @@ fn app() -> Element {
test_form_input {}
test_form_submit {}
test_select_multiple_options {}
test_unicode {}
}
}
}
@@ -576,3 +577,29 @@ fn test_select_multiple_options() -> Element {
}
}
}
fn test_unicode() -> Element {
// emulate an oninput event with a unicode character
utils::mock_event_with_extra(
"unicode",
r#"new InputEvent("input", {
inputType: 'insertText',
bubbles: true,
cancelable: true,
})"#,
r#"
element.value = "🦀";
"#,
);
rsx! {
input {
id: "unicode",
oninput: move |event| {
println!("{:?}", event.data);
assert_eq!(event.data.value(), "🦀");
RECEIVED_EVENTS.with_mut(|x| *x += 1);
}
}
}
}