-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the Other Amount
input in a price set to not autocomplete
#19923
Conversation
(Standard links)
|
So the solution is for CiviCRM to safeguard against potential bad autofill? |
Yes, the solution for CiviCRM is to play it safe on form fields and set autocomplete off when there's no benefit to not having it. It's a one-line code change that prevents browsers from interfering with payment form amounts. Seems to me like it's a small change that has no downside. |
This is Chrome on Windows 10: It's actually pretty unreliable behaviour wise sometimes - testing this I've seen different behaviour in how browsers and password managers handle the field some of them are trying to autocomplete it and some combinations aren't with Side note: I feel dirty :-D I installed Chrome on 3 devices to test this :-/ |
@eileenmcnaughton happy to expand this to other forms that have similar issues - assuming we accept the logic that there are just some fields that don't benefit in any way from AutoComplete :-) |
Whilst noting the issues with Chrome's compliance with the standard I am supportive of this |
@eileenmcnaughton I agree that this would be good to prevent autofill. I have all autofill turned off always, but I'm a bit surprised that Chrome would think that an amount field like this would make sense to autofill. I agree that there are probably tons of other fields to do this on. However, I think it makes sense to just merge this as-is and be prepared for other PRs doing the same sort of thing elsewhere. A few reasons why:
|
Thanks for the input @agh1 & the PR @MikeyMJCO & tetsing @KarinG (and lets not forget @seamuslee001's supportive mumuring :-))- merging |
Fwiw, this little patch did not make it to ESR. I was just about to update to 5.33.5 and will have to edit core directly again. How do things make it to ESR? |
@nc3man - we normally backport regressions fixes and security fixes to the ESR but not general bug fixes (if we did it would quickly stop looking like an ESR and look a lot more like 'latest stable') - this looks like a general bug fix to me |
@eileenmcnaughton got it. And not even a "general" bug fix. Almost too specific to both Chrome and specific form fields. I'll test, for grins, before applying the edit just to see if Chrome has gotten wiser. |
Overview
I can't see a use case where autocomplete in this field is useful, but not having it explicitly set to off is becoming an issue in recent versions of Chrome which guess wildly at what the field is for. https://chat.civicrm.org/civicrm/pl/qyrpehyojffwxdm8s1fzf3pmsr.
Before
Browser guesses at autocomplete type for this field (reproduced in Chrome on Windows and Ubuntu 20.04 but could not reproduce on Mac OS (thanks @KarinG <3 )
After
Explicitly sets the field to
autocomplete=off
telling browsers not to try and autocomplete this field.