feat: preventing enter in signin text fields
This commit is contained in:
parent
93cacdb8e5
commit
482e5d60a4
|
@ -52,9 +52,7 @@ pub fn SignIn(props: &Props) -> Html {
|
|||
});
|
||||
|
||||
let status_callback = props.status_callback.clone();
|
||||
let onsubmit = Callback::from(move |event: SubmitEvent| {
|
||||
event.prevent_default();
|
||||
|
||||
let onsubmit = Callback::from(move |_| {
|
||||
let state = state.deref().clone();
|
||||
|
||||
session.login(
|
||||
|
@ -66,7 +64,7 @@ pub fn SignIn(props: &Props) -> Html {
|
|||
});
|
||||
|
||||
html! {
|
||||
<form class="auth-container" onsubmit={onsubmit}>
|
||||
<div class="auth-container">
|
||||
<div class="auth-field">
|
||||
<label for="username">{"Username"}</label><br/>
|
||||
<input class="auth-input" type="text" name="username" onchange={on_username_changed}/><br/>
|
||||
|
@ -78,12 +76,12 @@ pub fn SignIn(props: &Props) -> Html {
|
|||
</div>
|
||||
|
||||
<div class="center-x">
|
||||
<button class="auth-submit" type="submit">{"Sign In"}</button>
|
||||
<button class="auth-submit" onclick={onsubmit}>{"Sign In"}</button>
|
||||
</div>
|
||||
|
||||
<div class="center-x">
|
||||
<p class="auth-status">{props.status.clone()}</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue