Skip to content

Commit

Permalink
[Menu] Fix nested menus that can't be clicked issue
Browse files Browse the repository at this point in the history
This fixes a regression that was introduced in mui#3360. The previous `click-awayable` mixin listened on `mouseup` and `touchend` events and the new `ClickAwayListener` was implemented to use `mousedown` and `touchstart` events. This commit changes the events to mimick the behavior from the original mixin.

Resolves mui#3818
  • Loading branch information
newoga authored and Cuong Le committed Apr 20, 2016
1 parent c08aa54 commit 806ad5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/internal/ClickAwayListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const isDescendant = (el, target) => {
return false;
};

const clickAwayEvents = ['mousedown', 'touchstart'];
const clickAwayEvents = ['mouseup', 'touchend'];
const bind = (callback) => clickAwayEvents.forEach((event) => events.on(document, event, callback));
const unbind = (callback) => clickAwayEvents.forEach((event) => events.off(document, event, callback));

Expand Down

0 comments on commit 806ad5f

Please sign in to comment.