You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Description
I have a functionality that is common for all menu item clicks, so I decided to have that in the onClick handler of the Menu, expecting the menuOnclickHandler would be called for each MenuItem click. But this is not happening if the MenuItem is from a MenuRadioGroup. Also the onClick handler on the RadioMenuItem is not getting called either. Is this intentional? If so what is the reason behind it. Or is this a bug?
React-Menu was originally design to only handle certain events which are necessary for its functionalities. Because the onClick is not required for MenuItems in a radio group, the event is not fired.
Start from v1.1.0, all DOM events are forwarded to the internal DOM element, so it might be necessary add the onClick event in MenuItem to keep the behaviour consistent.
I will consider the impact of this request on the design and backward-compatibility and release a fix in the next version.
This is released in v1.6.0.
The onClick event will fire on menu items inside a MenuRadioGroup, and then bubble up to the Menu component. The onChange event on MenuRadioGroup still fires as normal.
Problem Description
I have a functionality that is common for all menu item clicks, so I decided to have that in the onClick handler of the Menu, expecting the menuOnclickHandler would be called for each MenuItem click. But this is not happening if the MenuItem is from a MenuRadioGroup. Also the onClick handler on the RadioMenuItem is not getting called either. Is this intentional? If so what is the reason behind it. Or is this a bug?
CodeSandbox example
https://codesandbox.io/s/serene-minsky-g6xeh?file=/src/App.js
In that example you can notice, that when clicked on the RadioMenuItems, results are not getting updated.
Thanks in advance! :)
The text was updated successfully, but these errors were encountered: