add autocomplete arg to passwordInput#669
Conversation
| type: { | ||
| summary: 'on | off' | ||
| }, | ||
| defaultValue: { summary: 'undefined' } |
| errorMessage?: string; | ||
| feedbackMessage?: FeedbackMessage; | ||
| disabled?: boolean; | ||
| autocomplete?: 'on' | 'off'; |
There was a problem hiding this comment.
From the MDN:
The attribute value is either the keyword off or on, or an ordered list of space-separated tokens.
We also had current-password which is now the default autocomplete getter value, and we are setting to new-password when it's off ? 🤔
There's a typing issue for me here
There was a problem hiding this comment.
@Miexil the new-password thing was discovered a couple sprints ago for EmailInput component, i remember it's because Chrome doesn't really support off but new-password is somehow a value that all browsers settled on for some reason (don't ask me why 😂)
There was a problem hiding this comment.
I'm not really questioning the new-password only mentioning that possible values are not only limited to on or off and taking the code from the getter below as an example
There was a problem hiding this comment.
Yes, "current-password" will autocomplete the password field to your... well... current password. "new-password" states that the password that will be added is new, so there should not be any autocompletion on this field.
So to recap:
- Previous behavior was defaulting to "current-password" - that is still the case
- Adding
@autocomplete="off"will use "new-password" to disable the autocomplete
What does this PR do?
OSS::PasswordInputnow supports a newautocompleteoptional arg, being set either toonoroff. It allows the input to disable its default autocompletion.Related to: #
What are the observable changes?
With

autocompleteundefinedWith

autocomplete="off"Good PR checklist