prevent default redirect on web forms

This commit is contained in:
Evan Almloff 2023-04-01 19:29:17 -05:00
parent adade2d5c5
commit 1578cbeda4

View file

@ -54,6 +54,10 @@ impl WebsysDom {
let element = walk_event_for_id(event);
let bubbles = dioxus_html::event_bubbles(name.as_str());
if let Some((element, target)) = element {
// Prevent forms from submitting and redirecting
if name == "submit" {
event.prevent_default();
}
if target
.get_attribute("dioxus-prevent-default")
.as_deref()