Disable chrome autofill from filling automatically in Formik form based out of MUi components

33 views Asked by At

I have a react form which uses formik library and uses MUI components for inputs.

On form load the values like password and username gets autofilled by the chrome autofill.

tried this https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion but this doesn't seems to be working.

1

There are 1 answers

1
Felix Kniest On

In my experience browsers autofill input fields based on their name attribute.

If you want Browsers to stop autofilling, you can come up with a creative name that other pages don't commonly use:

<input type="text" name="username" />
<input type="text" name="useridentificator" />

I'd stick to something more descriptive than this though...