Fix web eval return (#3656)

* Fix web eval return

* add regression test to playwright
This commit is contained in:
Evan Almloff authored and GitHub committed 2025-01-27 12:57:20 -08:00
1 parent fb7b1a30bf
commit bd30516490
2 files changed
+30 -20

No files matched your search

@@ -25,6 +25,13 @@ fn app() -> Element {
button {
class: "eval-button",
onclick: move |_| async move {
// Make sure normal return values work. Regression test for https://github.com/DioxusLabs/dioxus/issues/3655
let eval = document::eval(r#"return "hello world";"#);
let result = eval.await.unwrap();
assert_eq!(result, "hello world");
// Make sure dioxus.send/dioxus.recv works
let mut eval = document::eval(
r#"
window.document.title = 'Hello from Dioxus Eval!';