-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Autocomplete fields #26467
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
Merged
Merged
[4.0] Autocomplete fields #26467
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull request for joomla#26459 Unless I am missing something then this docblock in all fields is wrong https://github.com/joomla/joomla-cms/blob/bc42bb1e43d96334c38222dbe49b83f898413f2a/layouts/joomla/form/field/password.php#L20 All we ever do is this https://github.com/joomla/joomla-cms/blob/bc42bb1e43d96334c38222dbe49b83f898413f2a/layouts/joomla/form/field/password.php#L72 Which means that we can never have any value for autocomplete in the xml other than 'off' You can see this by changing the value for autocomplete here to anything else and instead of the autocomplete being output with the new value it is removed. https://github.com/joomla/joomla-cms/blob/bc42bb1e43d96334c38222dbe49b83f898413f2a/administrator/components/com_users/forms/user.xml#L20-L30 Autocomplete has a lot of useful values that we could/should be using see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete For example `autocomplete=off` really doesn't do anything on password fields. Instead we should be using `autocomplete="new-password"` It looks to me that it can be _fixed_ by changing the code to `$autocomplete ? '' : 'autocomplete="' . $autocomplete .'"',` And autocomplete is not the same as autofill > Chrome will still respect this tag for autocomplete data, it will not respect it for autofill data But I am probably missing something cc @HLeithner @wilsonge @mbabker
Quy
reviewed
Oct 4, 2019
|
I have tested this item ✅ successfully on 3886e84 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26467. |
1 similar comment
|
I have tested this item ✅ successfully on 3886e84 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26467. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26467. |
|
Thanks! |
|
Thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request for #26459
The docblock in all fields is wrong
joomla-cms/layouts/joomla/form/field/password.php
Line 20 in bc42bb1
All we ever do is see if it is "on" or "off"
For example
joomla-cms/layouts/joomla/form/field/password.php
Line 72 in bc42bb1
Which means that we can never have any value for autocomplete in the xml other than 'off'
You can see this by changing the value for autocomplete here to anything else and instead of the autocomplete being output with the new value it is removed.
joomla-cms/administrator/components/com_users/forms/user.xml
Lines 20 to 30 in bc42bb1
Autocomplete has a lot of useful values that we could/should be using see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
For example
autocomplete=offreally doesn't do anything on password fields. Instead we should be usingautocomplete="new-password"This PR allows for the correct usage of the autocomplete element so that it supports all element values.
Testing is super simple. Apply the PR and then edit or add an autocomplete element to any field xml and see what is generated in the source