|
|
|
|
|
by Cldfire
1915 days ago
|
|
> One example is how almost every password manager including the built-in one in most browsers will assume that if there's a type="password" field, then the previous sibling field must be the username. Sometimes they'll even pick a field far away in the DOM like your chatbox input to autofill with the username. Note that this behavior is defined as part of the `autocomplete` standard. https://html.spec.whatwg.org/multipage/form-control-infrastr... > an input element whose type attribute is in the Text state that is followed by an input element whose type attribute is in the Password state > New autofill field name: "username" The intent isn't to pick a field far away in the DOM, though, so any autofill implementation doing that isn't being restrictive enough. |
|
And even if it did work, a spec is always underspecified even for the password manager who wants to follow it 1:1, so even in a best case scenario, you don't have implementation consensus. For example, you would think password manager heuristics wouldn't look outside the current <form> to assume the username field, but some do on some browsers.
The end result is that if you have a need that isn't the general case, you end up having to trade away UX to cater to software.