-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Chip] Control clickable property #13056
Conversation
@oliviertassinari @mbrookes Can you please review my PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The visual state will now indicate that the chip is not clickable but clicking the chip will still trigger the attached handlers. This might be confusing for users.
What is the use-case for this?
You could already solve this by using:
const { clickable, onClick } = props;
<Chip clickable={clickable} onClick={clickable && onClick} />
If anything I think we should warn if users set clickable
to false and onClick
to a function.
@eps1lon . The use case - We had a request as follows: "This would be much better if having clickable={false} OnClick={() => { do something}}. I would like that to disable the click. As of right now, if you have an onclick, clickable does absolutely nothing. The feature that would be much better if styling and making the onclick not function not work. As clickable false, seems like the "chip" should be disabled" |
People always want to do crazy stuff. Very often, we are allowing them. @zachrickards would you mind sharing your use case? The issue with the warning is that people can no longer easily have an |
a160fe0
to
a3074f2
Compare
@vilvaathibanpb Thank you |
@oliviertassinari Always welcome 👍 |
Closes #13052