docs: comments for the event handling in login

This commit is contained in:
Jeremy Wall 2023-12-04 14:48:50 -05:00
parent 8942eb59a5
commit 6e0e00c7f3

View File

@ -31,7 +31,8 @@ pub fn LoginForm<'ctx, G: Html>(cx: Scope<'ctx>, sh: StateHandler<'ctx>) -> View
info!("Attempting login request");
let (username, password) = ((*username.get_untracked()).clone(), (*password.get_untracked()).clone());
// NOTE(jwall): This is required if we want to keep the below auth request from
// failing to send with blocked by browser.
// failing to send with blocked by browser. This is because it's on a click and
// the form tries to do a submit event and aborts our network request.
evt.prevent_default();
if username != "" && password != "" {
spawn_local_scoped(cx, async move {