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

Add onClick event to Avatar #1819

Closed
NathanPB opened this issue Feb 16, 2021 · 1 comment
Closed

Add onClick event to Avatar #1819

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

Comments

@NathanPB
Copy link
Contributor

I'm submitting a ... (check one with "x")

[ ] bug report
[ x ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

At the moment, the Avatar component does not support onClick listeners. Any reason why?

@mertsincan mertsincan changed the title Clickable Avatar Add onClick event to Avatar Feb 22, 2021
@mertsincan mertsincan self-assigned this Feb 22, 2021
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Feb 22, 2021
@mertsincan mertsincan added this to the 6.1.0 milestone Feb 22, 2021
@NathanPB
Copy link
Contributor Author

@mertsincan quick suggestions: Why don't instead of manually passing every prop (like onClick, onImageError), we just use deconstructors?

export function Avatar({  image, label, classNames, ...props }) {
  return (
    <div className={/* wrapper classes */} {...props}>
     { */ avatar render logic here /* }
    </div>
  )
}

So every extra prop passed in the <Avatar/> will be attached to the Avatar's wrapper...

This would fix a lot of my concerns about primereact (not able to onClick random components, not able to ref, props not passed to the wrapper in general)

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