Fix react-contextmenu patch
This commit is contained in:
parent
cd3e82c098
commit
fd9e3ea7e0
1 changed files with 14 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
diff --git a/node_modules/react-contextmenu/modules/ContextMenu.js b/node_modules/react-contextmenu/modules/ContextMenu.js
|
diff --git a/node_modules/react-contextmenu/modules/ContextMenu.js b/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||||
index 2f88213..150f93e 100644
|
index 2f88213..d41a53c 100644
|
||||||
--- a/node_modules/react-contextmenu/modules/ContextMenu.js
|
--- a/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||||
+++ b/node_modules/react-contextmenu/modules/ContextMenu.js
|
+++ b/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||||
@@ -81,6 +81,11 @@ var ContextMenu = function (_AbstractMenu) {
|
@@ -81,6 +81,11 @@ var ContextMenu = function (_AbstractMenu) {
|
||||||
|
@ -40,15 +40,15 @@ index 2f88213..150f93e 100644
|
||||||
_this2.menu.style.opacity = 0;
|
_this2.menu.style.opacity = 0;
|
||||||
_this2.menu.style.pointerEvents = 'none';
|
_this2.menu.style.pointerEvents = 'none';
|
||||||
+
|
+
|
||||||
+ if (this.previousFocus && this.previousFocus.focus) {
|
+ if (_this2.previousFocus && _this2.previousFocus.focus) {
|
||||||
+ this.previousFocus.focus();
|
+ _this2.previousFocus.focus();
|
||||||
+ this.previousFocus = null;
|
+ _this2.previousFocus = null;
|
||||||
+ }
|
+ }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/node_modules/react-contextmenu/modules/SubMenu.js b/node_modules/react-contextmenu/modules/SubMenu.js
|
diff --git a/node_modules/react-contextmenu/modules/SubMenu.js b/node_modules/react-contextmenu/modules/SubMenu.js
|
||||||
index ad1dc70..ef0c960 100644
|
index ad1dc70..4604898 100644
|
||||||
--- a/node_modules/react-contextmenu/modules/SubMenu.js
|
--- a/node_modules/react-contextmenu/modules/SubMenu.js
|
||||||
+++ b/node_modules/react-contextmenu/modules/SubMenu.js
|
+++ b/node_modules/react-contextmenu/modules/SubMenu.js
|
||||||
@@ -129,6 +129,7 @@ var SubMenu = function (_AbstractMenu) {
|
@@ -129,6 +129,7 @@ var SubMenu = function (_AbstractMenu) {
|
||||||
|
@ -83,7 +83,7 @@ index ad1dc70..ef0c960 100644
|
||||||
_this.state = (0, _objectAssign2.default)({}, _this.state, {
|
_this.state = (0, _objectAssign2.default)({}, _this.state, {
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
@@ -202,21 +213,24 @@ var SubMenu = function (_AbstractMenu) {
|
@@ -202,32 +213,28 @@ var SubMenu = function (_AbstractMenu) {
|
||||||
if (this.props.forceOpen || this.state.visible) {
|
if (this.props.forceOpen || this.state.visible) {
|
||||||
var wrapper = window.requestAnimationFrame || setTimeout;
|
var wrapper = window.requestAnimationFrame || setTimeout;
|
||||||
wrapper(function () {
|
wrapper(function () {
|
||||||
|
@ -122,11 +122,14 @@ index ad1dc70..ef0c960 100644
|
||||||
+ }
|
+ }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var cleanup = function cleanup() {
|
- var cleanup = function cleanup() {
|
||||||
@@ -227,7 +241,8 @@ var SubMenu = function (_AbstractMenu) {
|
- _this2.subMenu.removeEventListener('transitionend', cleanup);
|
||||||
_this2.subMenu.style.left = '100%';
|
- _this2.subMenu.style.removeProperty('bottom');
|
||||||
_this2.unregisterHandlers();
|
- _this2.subMenu.style.removeProperty('right');
|
||||||
};
|
- _this2.subMenu.style.top = 0;
|
||||||
|
- _this2.subMenu.style.left = '100%';
|
||||||
|
- _this2.unregisterHandlers();
|
||||||
|
- };
|
||||||
- this.subMenu.addEventListener('transitionend', cleanup);
|
- this.subMenu.addEventListener('transitionend', cleanup);
|
||||||
+ this.subMenu.removeEventListener('transitionend', this.cleanup);
|
+ this.subMenu.removeEventListener('transitionend', this.cleanup);
|
||||||
+ this.subMenu.addEventListener('transitionend', this.cleanup);
|
+ this.subMenu.addEventListener('transitionend', this.cleanup);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue