Only update state if menu is not already open.

This makes it possible to use on iOS/touch
This commit is contained in:
Paul Kaplan committed 2018-02-26 11:19:47 -05:00
1 parent e56d69ccc3
commit 77972be35b
1 file changed
+2 -6
+2 -6
View File
@@ -27,16 +27,12 @@ class ActionMenu extends React.Component {
this.closeTimeoutId = null;
}, CLOSE_DELAY);
}
handleToggleOpenState (e) {
if (!this.state.isOpen) {
e.stopPropagation(); // For touch start, to prevent clicking primary button
}
handleToggleOpenState () {
// Mouse enter back in after timeout was started prevents it from closing.
if (this.closeTimeoutId) {
clearTimeout(this.closeTimeoutId);
this.closeTimeoutId = null;
} else {
} else if (!this.state.isOpen) {
this.setState({
isOpen: true,
forceHide: false