alphagov / govuk-design-system-backlog

GOV.UK Design System Community Backlog
31 stars 2 forks source link

can find a password input mask #265

Closed markgov closed 1 year ago

markgov commented 2 years ago

What

Hi not sure if there is or is not a an input mask that masks users input when entering a password

Why

Explain why you think this should be added to the GOV.UK Design System. needed if you want to create login prompts and web based password resets

Anything else

Include links to any examples, research or code to support your proposal, if available.

domoscargin commented 1 year ago

Hi @markgov,

Thanks for your contribution. I think what you're describing matches up to the "Show Password" component, so I'll close this and point you over there to add your findings and need.

If it's not the same thing at all, please feel free to open another issue with more detail.

querkmachine commented 1 year ago

The masking of text in password inputs is a browser feature, not one implemented specifically by the GOV.UK Design System.

If you're using our Nunjucks macros, you can activate this with our Text Input component by setting the type parameter to password.

{{ govukInput({
  type: "password",
  autocomplete: "current-password",
  id: "password",
  name: "password",
  label: {
    text: "Enter your password"
  }
}) }}

You may also want to set the autocomplete parameter to either new-password or current-password, depending on the context.