aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHayleigh Thompson <me@hayleigh.dev>2023-09-10 20:40:07 +0100
committerHayleigh Thompson <me@hayleigh.dev>2023-09-10 20:40:07 +0100
commitaa61631a51fdd39db00d142b46eddf5cff2a3aa0 (patch)
treeb244defa69e9e87c33502940f863eb0fba9ac075
parente04d6cd53eb03c08528893f1fd89fc5e2f0a7b65 (diff)
downloadlustre-aa61631a51fdd39db00d142b46eddf5cff2a3aa0.tar.gz
lustre-aa61631a51fdd39db00d142b46eddf5cff2a3aa0.zip
:bug: Fixed a bug where the submit event wouldn't prevent default.
-rw-r--r--lib/src/lustre/event.gleam4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/src/lustre/event.gleam b/lib/src/lustre/event.gleam
index bbd39c7..7913ef5 100644
--- a/lib/src/lustre/event.gleam
+++ b/lib/src/lustre/event.gleam
@@ -127,7 +127,9 @@ pub fn on_check(msg: fn(Bool) -> msg) -> Attribute(msg) {
}
pub fn on_submit(msg: msg) -> Attribute(msg) {
- use _ <- on("submit")
+ use event <- on("submit")
+ let _ = prevent_default(event)
+
Ok(msg)
}