DioxusLabs / DioxusLabs/dioxus
Username and password fields auto filled but not their connected signals
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
The saved credentials of the browser fill the form fields, but not the attached signals. So if login is pressed with the autofilled login form, the login request has empty login and password fields...
**Steps To Reproduce**
Steps to reproduce the behavior:
1. Safe credentials in browser password store
2. go to the login page
3. see that the login fields are automatically filled
4. press on login
5. check the requests
6. observe the requests do not contain the autofilled data
Sometimes it works, but after a reload of the login page i can reproduce it consistently... the fields are filled out and the signals are still empty.
If only one letter is removed and added again, then the login request succeeds since now the change event fired which in turn updated the signal.
**Expected behavior**
I'd expect that the "autofill action" of the browser triggers the change event.
**Code snippets**
```rust
let mut username = use_signal(|| "".to_string());
```
```rust
input {
autofocus: true,
r#type: "text",
class: "input",
value: "{username}",
oninput: move |e| {
username.set(e.value());
},
}
```
```rust
button {
class: "button is-primary",
onclick: move |_| {
async move {
match backend::auth_api::login(username(), password()).await {
Ok(u) => {
user.set(Some(u));
nav.push(Route::Home {});
}
Err(e) => {
let fehlernachricht = t!("failed-login", error : e.to_string());
nachricht.set(Some(fehlernachricht));
info!("Failed to login: {:?}", e);
}
}
}
},
{t!("login")}
}
```
The page I'm developing can be tested at: https://demo.pslink.teilgedanken.de/app/
The complete login file of my project: https://github.com/enaut/pslink/blob/d5b9c5fc0df5504eccbe6d19ef29b46c4c01d31c/ui/src/login.rs
**Screenshots**
**Environment:**
- Dioxus version: v0.6.3
- Browser: firefox, chrome
- App platform: web
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.