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
It's a fragment from menu-item.jsx. It's weird that you only attach onTouchTap when menu item has nested menu items. Is it ok? I tried to hack it with attaching an empty array of menu items but it also didn't help. Don't know why.
Update:
What is even worse this is non deterministic behaviour. When I put some breakpoints in the following function
onTouchTap works. Without breakpoints it doesn't fire.
Update 2
I've found what is responsible for those problems. The ClickAwayListener thinks that nested menu is not a descendant of menu and fires onClickAway event which breaks somehow onClick event.
With commented this one line
if (document.documentElement.contains(event.target) && !isDescendant(el, event.target)) {
// _this.props.onClickAway(event);
}
everything started working. That change broke Popover (can't hide on click away) but didn't break Menu which now is working perfect (still hides on click away, dunno why).
Versions
Material-UI: 0.15.0-alpha.1
React: 0.14.6
Browser: Chrome 48.0.2564.116
The text was updated successfully, but these errors were encountered:
niba
changed the title
Menu item onTouchTap doesn't work.
Nested menu item onTouchTap/onClick doesn't work.
Mar 10, 2016
niba
changed the title
Nested menu item onTouchTap/onClick doesn't work.
[Menu][NestedMenuItem] Nested menu item onTouchTap/onClick doesn't work.
Mar 10, 2016
@niba@antialiasis Sorry, first time seeing this issue. Thanks for the analysis/thorough description. We've actually been tracking this issue here: #3818, and have a PR open with the fix here: #3947. It's slated to be fixed before our 0.15.0 release. I'll close this (even though you opened it up first). Thanks much!
Problem Description
OnTouchTap event doesn't fire after clicking menu item. I've also tried onClick without success. I've react tap event plugin.
In your code I found these lines:
It's a fragment from menu-item.jsx. It's weird that you only attach onTouchTap when menu item has nested menu items. Is it ok? I tried to hack it with attaching an empty array of menu items but it also didn't help. Don't know why.
Update:
What is even worse this is non deterministic behaviour. When I put some breakpoints in the following function
onTouchTap works. Without breakpoints it doesn't fire.
Update 2
I've found what is responsible for those problems. The ClickAwayListener thinks that nested menu is not a descendant of menu and fires onClickAway event which breaks somehow onClick event.
With commented this one line
everything started working. That change broke Popover (can't hide on click away) but didn't break Menu which now is working perfect (still hides on click away, dunno why).
Versions
The text was updated successfully, but these errors were encountered: