-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Password: Add autocomplete property for input #12362
Comments
As a dirty workaround, it’s still possible to do this : @Component({
selector: 'app-my-component',
templateUrl: '<p-password #newPwdInput
[feedback]="true"
[toggleMask]="true"
[(ngModel)]="newPassword"
id="new-password"></p-password>'
})
export class MyComponent implements AfterViewInit {
@ViewChild('newPwdInput') newPwdInput: Password;
newPassword: string;
constructor() {}
ngAfterViewInit() {
this.newPwdInput.input.nativeElement.autocomplete = 'new-password';
}
} |
The same. We also need the ability to pass attributes to input so that the browser reacts correctly. Waiting for decision... |
In case anyone has the view hidden, and the password input is lazy loaded, for example when the form is loaded on a hidden sidebar, you can use the same approach than @t4keo, but instead using ngAfterViewInit use:
|
Fixed in #11020 |
Describe the feature you would like to see added
I want to use the p-password component because it’s less buggy than the directive (I just opened 2 issues) but I can’t set the "autocomplete" value directly via the component meaning that my browser think that it’s the current-password that I’m trying to set while it's the new one.
This could be avoided by adding an "inputAutocomplete" attribute to the component. This would just translate the inputAutocomplete to [attr.autocomplete]="valueOfInputAutocompleteProperty" and allow us to set it’s type so the browser knows which input means what.
Is your feature request related to a problem?
The pPassword directive is not working well and not like p-password component
Describe the solution you'd like
adding inputAutocomplete property to p-password component.
See : https://developer.mozilla.org/en/docs/Web/HTML/Attributes/autocomplete
Describe alternatives you have considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: