My project is in ReactJS and Redux and I am using redux-form for my forms. I have two forms (both have input type text and password fields) in a page in my website. Now, chrome shows the autofill list for one form in the other and it is not working properly due to which bounce rate in my website has increased.
I would like to disable the autofill and autocomplete dropdown list but not getting any solution for this. My Chrome version is Version 71.0.3578.98.
I have tried the following things (as read from other Stack Overflow links); but none of them works.
- Use autocomplete values off/nope/new-password (Looks like chrome ignores this in case of username/password fields) (https://stackoverflow.com/a/38257374/6487887) (Disabling Chrome Autofill)
- Use autocomplete="off" for form instead of input fields
- Using a hidden input type text and password (https://www.20spokes.com/blog/what-to-do-when-chrome-ignores-autocomplete-off-on-your-form)
- Using different names for the various fields
- Making field readonly and then remove readonly on focus
The only this which seems to work properly is make the fields readonly and remove readonly when user starts to type (onKeyDown event). Then if user presses the backspace and input is empty, make is readonly again otherwise the autofill dropdown list again shows up. This solution is more of a hack and I would like to know any better solution for this.
PS: This is a duplicate question but I have not got any relevant solution for this which works in new version of Chrome. Links which I followed: Disabling Chrome Autofill, Chrome ignores autocomplete="off", How to disable Chrome to autofill username/email password?, Disable Google Chrome Autocomplete / Autofill / Suggestion and a lot more.