1

Hello i tried to create a new form to add new user, this form contain an input 'username' & another one 'password', my probleme is when i open the form the field username and password get by default the user and password saved in browser , i tried to user autoComplete='false' but it doesn't work.

My question is how to disable this feature, any hint can be helpfull

This is how it looks this is how it looks

Salah ED
  • 535
  • 7
  • 17

3 Answers3

4

I fixed this problem by adding autoComplete="new-password" to the Input.Password

<Input.Password placeholder="Mot de Passe" autoComplete="new-password" />
Salah ED
  • 535
  • 7
  • 17
  • This is not working for me. Does this still work for you @salah-ed –  Oct 19 '22 at 06:23
  • are you sur that you have the same problem as me ? because it works perfectly in my code – Salah ED Oct 25 '22 at 09:17
  • Yes, I want to add one thing though if I have multiple passwords saved, then the browser is confused to autoFill the password. In that case, the password is not auto-filled. But if I just had one single password then it is being filled in automatically. Can you check if you have multiple passwords saved for this form? –  Oct 25 '22 at 10:11
  • no i have only one password, so you want to fill automaticlly the password in that input when you have multiple passwords saved? – Salah ED Oct 25 '22 at 10:19
  • No. I don't want my passwords to auto-fill in any case. I am using inside antd
    component. Is that causing this issue?
    –  Oct 25 '22 at 10:34
  • My need is to remove the autofill not to fill automaticlly – Salah ED Oct 25 '22 at 10:35
  • Same for me as well –  Oct 25 '22 at 10:45
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/249037/discussion-between-gana-and-salah-ed). –  Oct 25 '22 at 11:08
0

Some versions of the browsers ignore these attributes autoComplete.

please check this Ans of this problem

Md Rana Hossain
  • 304
  • 2
  • 7
0

I know this is an old question, but I was facing the same dilemma and I just used a walkaround that feels like the easier thing to do. So will leave it here in case some one else wants a quick solution to this issue.

Just use inital or default values

<Form
...
initialValues={{ email: '', password: '', <<any field>>: '' }}
...
>