Releases: dkozar/react-data-menu
Bug fixes and position-related class names
Perfect fit
Menu popups are now never cropped by screen edges.
Switched to using Raycast
I moved the event dispatching logic into separate project: https://github.com/dkozar/raycast-dom
Menu is a complex component, so with all of those mouse and touch listeners attached to popup and item renderers, it became unmaintainable.
Complex components with lot of children should really rely on event bubbling. That's what Raycast provides; with it, the menu component should be more logical and predictable.
Fixed the tap-and-hold bug
Fixed the bug of firing onContextMenu when tap-and-holding the toggle button of dropdown menu.
Tap-and-hold was previously closing the (just opened) menu when dropdown is in toggle mode.
Made the MouseEventDispatcher system more robust
Changed the way MouseEventDispatcher is processing browser events.
Fixed the touch screen bug
Touch events are now processed properly (so the menu works on touch screens).
In demo, I'm treating 'touchstart' similar to 'contextmenu': tapping the application background brings up the app menu, while tapping the circle brings the circle menu.
While menu is open, tapping the application background is closing it.
Fixed the dropdown menu bug
Dropdown menu was not properly closing when clicking away.
It was still open after opening another menu, so there were multiple menu instances floating around.
With this fix, opening another dropdown (or right-click menu) closes all the previous instances.
Stable version
1.0 README change