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

Improve Password implementation #1799

Closed
mertsincan opened this issue Feb 4, 2021 · 1 comment
Closed

Improve Password implementation #1799

mertsincan opened this issue Feb 4, 2021 · 1 comment
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@mertsincan
Copy link
Member

We made some improvements and added the following variables;

toggleMask?: boolean;     // Whether to show an icon to display the password as plain text.
appendTo?: any;    // Id of the element or "body" for document where the overlay should be appended to.
header?: any;      // Template of panel header if "feedback" is enabled.
content?: any;     // Template of panel content if "feedback" is enabled.
footer?: any;        // Template of panel footer if "feedback" is enabled.
icon?: any;        // Template of mask icon if "toggleMask" is enabled.
style?: object;        // Inline style of the element.
className?: string;         // Style class of the element.
inputStyle?: object;          // Inline style of the input field.
inputClassName?: string;   // Style class of the input field.
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Feb 4, 2021
@mertsincan mertsincan added this to the 6.0.2 milestone Feb 4, 2021
@mertsincan mertsincan self-assigned this Feb 4, 2021
mertsincan added a commit that referenced this issue Feb 4, 2021
@narayan-fintec
Copy link

narayan-fintec commented Jul 18, 2021

Please ignore. I am able to use template for 'icon'. Just had to read the 'renderIcon' method in (https://github.com/primefaces/primereact/blob/master/src/components/password/Password.js).

For adding into existing documentation - or for any future folks that may be searching for this, here's how it worked for me:
icon={({ className, onClick }) => (
<i className={className} onClick={onClick} style={{fontSize: "20px"}} />
)}


similar to 'inputStyle' - is it possible to pass a custom-style object for the existing icon (ie pi-eye & pi-eye-slash)?

When I pass icon={<i className="pi pi-eye" style={ fontSize: '20px' } />} as the template, this icon is rendered, but the "toggle" functionality no longer works.

I searched for any existing examples of how to use toggleMask template & particularly to see what the template looks like - but found none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

2 participants