Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!