mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 04:33:06 +00:00
prevent default redirect on web forms
This commit is contained in:
parent
adade2d5c5
commit
1578cbeda4
1 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue