Primefaces: Password: add icon for unmasking password

Created on 1 Feb 2021  路  3Comments  路  Source: primefaces/primefaces

I'm always frustrated when there's no option to reveal and hide a password.

A minimal eye icon to do so, placed right of the input field would be great.

The type attribute of the standard input was removed, so it's not possible to simply change it's value from password to text.

masked
unmasked

new feature theme

Most helpful comment

yeah but that uses Jquery to get at the underlying HTML inputs type field :) So it works.

All 3 comments

I do something like this in my production apps. See my Stack Overflow answer: https://stackoverflow.com/a/57163095/502366

Let me see if I can add something like this.

I do something like this in my production apps. See my Stack Overflow answer: https://stackoverflow.com/a/57163095/502366

Let me see if I can add something like this.

Thanks so much! Really appreciate it!

Actually, I've seen you're answer earlier today, but didn't think it was possible, because the PF Password component doesn't have the type attribute.

yeah but that uses Jquery to get at the underlying HTML inputs type field :) So it works.

Was this page helpful?
0 / 5 - 0 ratings