Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

label text is striking off MUI outlined input

I have an MUI outlined input, when I used it, it is showing me like below:
where "New Password" text is striked off

enter image description here

this is my code, can you anyone help me.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<FormControl fullWidth variant='outlined'>
    <InputLabel htmlFor='new-password'>New Password</InputLabel>
    <OutlinedInput
      id='new-password'
      className='marginBtm15px'
      value={newPassword}
      type={showPassword ? 'text' : 'password'}
      onChange={handleNewPasswordChange}
      endAdornment={
        <InputAdornment position='end'>
          <IconButton onClick={handleClickShowPassword} onMouseDown={handleMouseDownPassword}>
            {showPassword ? <p className='showHide'>Hide</p> : <p className='showHide'>Show</p>}
          </IconButton>
        </InputAdornment>
      }
    />
  </FormControl>

>Solution :

Add label props to the Outlined input component, which will prevent text from being cut off.

<FormControl fullWidth variant="outlined">
        <InputLabel htmlFor="new-password">New Password</InputLabel>
        <OutlinedInput
          id="new-password"
          className="marginBtm15px"
          label="New Password"
          onChange={() => {}}
          endAdornment={
            <InputAdornment position="end">
            ...
            </InputAdornment>
          }
        />
</FormControl>

Example

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading