Unless I am missing something then this docblock in all fields is wrong
|
* @var string $autocomplete Autocomplete attribute for the field. |
All we ever do is this
|
!$autocomplete ? 'autocomplete="off"' : '', |
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.
|
<field |
|
name="password" |
|
type="password" |
|
label="JGLOBAL_PASSWORD" |
|
autocomplete="off" |
|
class="validate-password-strength" |
|
filter="raw" |
|
validate="password" |
|
strengthmeter="true" |
|
force="on" |
|
size="30" |
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
Unless I am missing something then this docblock in all fields is wrong
joomla-cms/layouts/joomla/form/field/password.php
Line 20 in bc42bb1
All we ever do is this
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"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
But I am probably missing something
cc @HLeithner @wilsonge @mbabker