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

181
Visualizações
How to get the two Input control elements look exactly same in terms of background and border?

I am using Material UI to create a password field and normal textField

        <OutlinedInput
        
   
        type={showPassword ? "text" : "password"}
        variant="outlined"
        size="small"
        sx={{
          height: 38,
          width: 190,
        }}
        endAdornment={
          <InputAdornment position="end">
            <IconButton
              onClick={() =>
                setShowPassword((showPassword) => !showPassword)
              }
              onMouseDown={(event) => event.preventDefault()}
              edge="end"
            >
              {showPassword ? <VisibilityOff /> : <Visibility />}
            </IconButton>
          </InputAdornment>
        }
      />

and here is the normal text field -

<TextField
               
                onChange={onChange}
                variant="outlined"
                size="small"
                type="Text"
                className={classes.Text}
              />

The problem is that my password looks very different also the mouse click for the password entry is not good. Here is the screen shot. How can I make it look exactly like TextField but with that eye icon for password - show and hide?

Icon button and TextField

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You're using OutlineInput and TextField, respectively. These most likely have different CSS rules applied to them. Use the same component, or modify them so that their CSS are the same, and then you'll be good to go.

about 4 years ago · Juan Pablo Isaza Relatório

0

In the TextField, you can set endAdornment and add the icon, I provide the code snippet that you can try.

<TextField
          label="SIP Display Name"
          InputProps={{
            endAdornment: 
            <IconButton>
                <Visibility />
            </IconButton>
          }}
          .........
          variant="filled"
        />

about 4 years ago · Juan Pablo Isaza 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