From d9878fd35ca85ea0ff21584d270c7392cc891d65 Mon Sep 17 00:00:00 2001 From: Neil Gabbadon Date: Tue, 12 Apr 2016 01:15:43 -0400 Subject: [PATCH] [Menu] Fix nested menus that can't be clicked issue This fixes a regression that was introduced in https://github.com/callemall/material-ui/pull/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 #3818 --- src/internal/ClickAwayListener.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/ClickAwayListener.js b/src/internal/ClickAwayListener.js index bb39fbfdffe6ce..158ee332386cb5 100644 --- a/src/internal/ClickAwayListener.js +++ b/src/internal/ClickAwayListener.js @@ -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));