keystonejs / keystone-classic

Node.js CMS and web app framework
http://v4.keystonejs.com
MIT License
14.63k stars 2.21k forks source link

Admin email field is overwritten by Safari autocomplete #3186

Open ddaddy opened 8 years ago

ddaddy commented 8 years ago

Whenever I edit a user object in the admin panel on mobile (iOS), when the users page loads up the email field is autocompleted by Safari with email address. This is because of Safari's password autocomplete feature.

I can't make a change to the users record because on save it would attempt to insert my email address and there's no way to undo the email change in Safari.

This can be fixed simply by removing my stored login credentials for my site, however that's not an ideal solution.

What I propose is to use the method described here http://stackoverflow.com/questions/22661977/disabling-safari-autofill-on-usernames-and-passwords of placing a password and email field off screen, so browsers will auto fill them first and leave the genuine fields alone.

wmertens commented 8 years ago

wouldn't adding autocomplete=off work as well? PRs welcome.

ddaddy commented 8 years ago

From what I've read, autocomplete=off doesn't fix the issue.

wmertens commented 8 years ago

how about autocomplete=dontfillthisin? Maybe Safari will be not as willing then.

ghost commented 7 years ago

Hey @ddaddy @wmertens , I am new to GitHub, and I would like to contribute and fix this issue. Can I please, know where to begin ? I am unable to find and edit the required file. While I understand the task, error issue, and fix.

jstockwin commented 7 years ago

@theswm You'll need to fork your own copy of Keystone's repository, make the changes in your fork, and then make a pull request with the changes.

This help guide should be helpful, and links to how to create a pull request too!

ghost commented 7 years ago

@jstockwin Thank you Sir :)

I shall get cracking on this right away !

Russspruce commented 7 years ago

Hey, I don't know what the status of this is, but I would like to take a crack at it. I've already forked the project and will be trying my best to see if I can fix this bug.

Anything I should know about in advance?

Noviny commented 7 years ago

@Russspruce Nothing huge. Ping me if you make a PR for this, and I'll review it.

stennie commented 6 years ago

As per another answer on the StackOverflow question linked in the start of this discussion, ignoring autocomplete is apparently an intentional choice by browser developers: https://stackoverflow.com/a/28457066.

One of the top user-complaints about our HTML Forms AutoComplete feature is “It doesn’t work– I don’t see any of my previously entered text.” When debugging such cases, we usually find that the site has explicitly disabled the feature using the provided attribute, but of course, users have no idea that the site has done so and simply assume that IE is buggy. In my experience, when features are hidden or replaced, users will usually blame the browser, not the website.

Trying to circumvent password managers with fake elements would seem to push the problem back to autocomplete not working as expected for users who prefer the feature. IMHO it seems more sensible to let users control preferences in their browser rather than trying to force that through the admin UI.