Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

438
Visualizações
react material Ui textfield type password disable autofill from browser when focused on it

I am using react material UI 4 and I want to disable the browser autofill/auto complete suggestion when I focus on my password field which is coming from TextField.

My requirement is to not show suggestions when we focus on that field and the field type is password. For username and email it is working but for some reason it is not working for password field.

enter image description here

I have tried below appraoch but nothing is working

<TextField
   inputProps={{
      autoComplete: 'off'
   }}
/>

===============================
<TextField
  inputProps={{
     ...params.inputProps,
     autoComplete: 'new-password',
   }}
 />

=====================
<TextField
 autoComplete="new-password"
/>

=========================
//Below works but then this field no more acts as a password field

<TextField
   label="Password"
   className={classes.textField}
   name="password"
   inputProps={{
      type:"password",
      autoComplete: 'new-password'
   }} />

Any help will be appreciated. Thanks

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

try using the method I'm adding below. It worked for me.

<Textfield
  inputProps={{
    autocomplete: 'new-password',
    form: {
      autocomplete: 'off',
    },
  }}
  />
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>

Updated Answer: <TextField autoComplete="chrome-off" />

Let me know if you still face any issue.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda