Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextField] add show password feature #44778

Open
4rthurrr opened this issue Dec 15, 2024 · 1 comment
Open

[TextField] add show password feature #44778

4rthurrr opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information

Comments

@4rthurrr
Copy link

4rthurrr commented Dec 15, 2024

Summary

add show password feature when typing a password in sign in form and signup form (it s not apper in chrome)

Examples

No response

Motivation

No response

Search keywords: show password

@4rthurrr 4rthurrr added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 15, 2024
@mj12albert
Copy link
Member

@4rthurrr You can implement this using InputAdornments (doc)

const [showPassword, setShowPassword] = React.useState(false);

render(
  <FormControl>
    <InputLabel htmlFor="password">Password</InputLabel>
    <OutlinedInput
      id="password"
      type={showPassword ? 'text' : 'password'}
      endAdornment={
        <InputAdornment position="end">
          <IconButton
            aria-label={
              showPassword ? 'hide the password' : 'display the password'
            }
            onClick={handleClickShowPassword}
            onMouseDown={ev => ev.preventDefault()}
            onMouseUp={ev => ev.preventDefault()}
            edge="end"
          >
            {showPassword ? <VisibilityOff /> : <Visibility />}
          </IconButton>
        </InputAdornment>
      }
      label="Password"
    />
  </FormControl>
)

it s not apper in chrome

Are you using Edge? You may be referring to Edge's "password reveal button", see #44756

@mj12albert mj12albert added component: text field This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information labels Dec 16, 2024
@mj12albert mj12albert changed the title add show password feature [TextField] add show password feature Dec 16, 2024
@mj12albert mj12albert removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 16, 2024
@mj12albert mj12albert self-assigned this Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

2 participants