Reputation: 1
I'm working on a React application and I'm encountering an issue with Chrome's autofill feature. When I have input fields for usernames and passwords, Chrome automatically fills in the information, which is causing usability problems for my users. I want to disable this autofill behaviour for security and user experience reasons.
I've tried adding the autocomplete="off" attribute to the input fields, but it doesn't seem to work as expected. Chrome continues to autofill the fieldsenter image description here below code
what need to do to remove autofill autoComplete=off
Upvotes: 0
Views: 1038
Reputation: 1
I think should be able to turn it off using the autocomplete prop on the input you can try something like this, by making the role equals presentation, together with autocomplete prop you already have, also set autocomplete to new-password for a password input field.
<form autocomplete="off">
<input role="presentation" type="text" name="username"
autocomplete="off" />
<!--OR-->
<input role="presentation" type="text" name="email" autocomplete="off"
/>
<input role="presentation" type="password" name="password
autocomplete="new-password" />
</form>
Upvotes: 0