-
Notifications
You must be signed in to change notification settings - Fork 216
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
Dropdown item onClick not firing when clicked #211
Comments
@jonathanwmaddison thanks for raising the issue. Is it related to #191? |
Can you paste a snippet of your component usage/implementation? This sounds like a |
@jossmac I don't think so. I think this is related to either how I'm passing in the props or an issue with how the prop is being bound to the onClick event in the Dropdown component. @clschnei Here you go:
Thank you! |
This definitely not a bug. So we can probably close this ticket. But to resolve your issue @jonathanwmaddison, you have two problems:
Should fix your problem. |
@clschnei Thank you for the suggestions and for looking at my code so quickly. Hopefully this will help other coders with the same problem, and missed how to do this. |
I'm passing down an array of items to a Dropdown component and for each I'm defining the value as a function. However, the onClick event doesn't get called when I click the item. I found that if I made a small adjustment to line 105 of Dropdown Component it works:
Current implementation:
{ className: 'Dropdown-menu__action', onClick: self.onClick.bind(self, item.value) },
Working Implementation:
{ className: 'Dropdown-menu__action', onClick: item.value },
Thanks for this nice looking UI kit!
The text was updated successfully, but these errors were encountered: