Summary: | autocomplete=off prevents refilling form fields on back/forward navigation | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, arv, beidson, jhawkins, ojan, sullivan, tkent, tony | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Alexey Proskuryakov
2010-10-09 22:02:16 PDT
This is still causing trouble for me, almost daily. Maybe Ojan has some insight into this issue? When you focus an email input field, the JS code sets autocomplete=off to avoid getting the browser built-in dropdown. I just did a quick test, apparently that disables the autofill behavior on back. So, that's certainly the cause. Is there another way to disable the browser dropdown? Can't preventDefault because that would also prevent inserting the character. I don't know the answer to your question. However, - is it a bug that autocomplete=off disables restoring form state on back/forward? - why doesn't the Bugzilla advanced search page go into b/f cache at least? Erik, do you know if there's a way to make this work, i.e., to avoid the browser dropdown when typing in an input, but keep the autofill behavior when going back? (In reply to comment #5) > Erik, do you know if there's a way to make this work, i.e., to avoid the browser dropdown when typing in an input, but keep the autofill behavior when going back? I don't know if there is another way to prevent the drop down but it seems wrong to not restore the input states when going back to a page. I don't see why autofill should be related to that behavior. Sounds like that's the bug to me. Who knows about form filling that we can CC here to confirm? This behavior for autocomplete is a part of fixing Bug 23346. I don't remember the specific reason for autocomplete... Could we perhaps remove autocomplete from these fields as a temporary measure? (In reply to comment #4) > I don't know the answer to your question. However, > - is it a bug that autocomplete=off disables restoring form state on back/forward? No, it is not a bug. It is intentional. Banks require that autocomplete=off means no form restoration on back/forward. (In reply to comment #9) > Could we perhaps remove autocomplete from these fields as a temporary measure? You mean turn off email autocomplete entirely or remove the autocomplete property? If you mean the latter, then it doesn't work very well because both the custom autocomplete and the browser's autocomplete menus show up. When the browser's menu is up, the custom menu doesn't function. I see a few options: 1. Go back to using browser extensions to enable autocomplete. 2. Use browser extensions to disable the custom autocomplete. 3. Add a new attribute that disables to browser autocomplete dropdown, but not formfill on page load. If someone is willing to do the work, 3 seems best since this it's likely other web developers will want it. I've been thinking of returning to built-in Bugzilla behavior for these two fields only. Personally, I see huge benefit from the new autocomplete when adding people to CC list. In advanced search, I'm more likely to know e-mail address (or a sufficient part of it) for the person upfront. (In reply to comment #12) > I've been thinking of returning to built-in Bugzilla behavior for these two fields only. Personally, I see huge benefit from the new autocomplete when adding people to CC list. In advanced search, I'm more likely to know e-mail address (or a sufficient part of it) for the person upfront. That certainly doesn't match my experience, but I don't feel strongly either way. Can we just re-enable autocomplete on form submit? Here's an example that turns off autocomplete on focus, but re-enables it on submit. It seems to remember the form contents when I press back. http://ponderer.org/tests/form-autocomplete.html Yeah. That seems to work. So really, we just need to add the following to where we set autocomplete="off": input.form.addEventListener("submit", function() { input.setAttribute("autocomplete", "on"); }, false); Created attachment 83454 [details]
Patch
Committed r79515: <http://trac.webkit.org/changeset/79515> Yay, it works! Thank you thank you thank you!!! |