-
Notifications
You must be signed in to change notification settings - Fork 911
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
Allow disabling of browser autocomplete #269
Comments
@arun-maddheshia I think it should be disabled by default. Will fix it. |
@varnastadeus thanx 👍 when it get it release :) |
@arun-maddheshia later today |
@varnastadeus autocomplete off is not working in chrome :( |
As it seems chrome ignores autocomplete off, but if you provide any semantic value then it will work. Not sure about other browsers though |
@varnastadeus so what workaround to do with ng select because if user autofills the search field its get broken. User unable to select the ng-select dropdown values. |
@varnastadeus with the last chrome update (v64.x) the workaround not working anymore, but I've noticed that the autocomplete doesn't break the select, but it only hide the selected value. Here a simple solution: ass to the css class .ng-select { z-index: -1; } and this solves the hiding problem. |
@varnastadeus any update on it, the issue is still exist. |
@arun-maddheshia please provide reproducible plnkr, I tried to reproduce it with no luck. |
@varnastadeus Just create a StackBlitz |
@arun-maddheshia thanks, will look at it |
To disable (fool) the autofill you need to set the input name attribute to something that chrome has not seen before and has no history of. Try uuid. |
As 30201c0 is merged now we have newId function which can be used on input name. |
@anjmao can we fix it please :) |
@arun-maddheshia have you looked at https://stackoverflow.com/questions/12374442/chrome-browser-ignoring-autocomplete-off? Setting |
@anjmao I tried all these things but nothing works, only solution is #269 (comment) |
The other option is to use
|
@arun-maddheshia I have added id as autocomplete value. |
@varnastadeus, unfortunately, it does not solve the problem. Chrome autofill still pops up on my browser. Chrome: Version 67.0.3396.87 (Official Build) (64-bit) |
Chrome: Version 68.0.3440.106 (Official Build) (64-bit) |
@varnastadeus, if I change it to |
instead of saying it doesn't work, create reproducible example proving it |
What I found for this bug and Chrome is that the labelForId is problematic.
|
As @vmanchev mentioned, |
Urgently needed and helpful.... |
@DonJuwe workaround: ngOnInit() {
setTimeout( () => {
document.querySelector('ng-select input[autocomplete]').setAttribute('autocomplete', 'off');
});
} |
@varnastadeus This should be reopened as the bug still exists, as prooven in the example provided by @DonJuwe |
Ok I have it reproducible so I will check it out. I will try to see if |
@smasala I used a similar approach but instead set the autocomplete value to something nonsensical ('foobar'), as it seems autocomplete=off was being ignored by Chrome now. |
@varnastadeus... Have you updated autocomplete = "off" on npm |
My workaround was to change input id in ngAfterViewInit() and adding timpestamp there:
|
@varnastadeus Hi, I'm still having this issue and tried everything here and other places but nothing is working. Here is my code :
The weird thing is if I delete the "for" in the label and the "labelForId" it is working, or I if delete one of the two or if one is not matching the other. Anyone have an idea of why is that ? ng-select version : 4.0.4 |
it doesn't work, please fix this bug soon |
@huynv86 , it still works fine for us (ng-select 7.0.1). Which ng-select version are you using? Do you have a repro? |
work me, nzPlaceHolder "ng-zorro-antd": "^13.1.0", |
Please fill below information if issuing a bug report.
Expected behaviour
Set the autocomplete attribute of the input field to "off", or allow passing it as an optional attribute so the search would work better.
Actual behaviour
right now the search results has double dropdown. One by the browser autocomplete, and one by the ng-select. looks wierd.
More Info
ng-select version: latest
browser: Chrome
reproducible in demo page: Yes
The text was updated successfully, but these errors were encountered: