oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

fix disable browser autocomplete - Closes #422 #423

Open nyvio opened 5 years ago

nyvio commented 5 years ago

Chrome doesn't take into account any more the html autocomplete="off" attribute. As a result, the browser's autocomplete suggestions will overlap the suggestions we actually want to display with this component.

The only available workaround for now seems to be to give a value which is semantically significant for the given input, but which can't be interpreted by the browser as a known value for autocomplete.

See here, the reply from Chromium on this specific issue: https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164

In cases where you really want to disable autofill, our suggestion at this point is to utilize the autocomplete attribute to give valid, semantic meaning to your fields. If we encounter an autocomplete attribute that we don't recognize, we won't try and fill it.

It is a quick and effective workaround, which has a real impact for us.

Feel free to comment, I'm open to discussion and happy to contribute.