Skip to content

Commit fd9e3ea

Browse files
Fix react-contextmenu patch
1 parent cd3e82c commit fd9e3ea

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

patches/react-contextmenu+2.14.0.patch

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/node_modules/react-contextmenu/modules/ContextMenu.js b/node_modules/react-contextmenu/modules/ContextMenu.js
2-
index 2f88213..150f93e 100644
2+
index 2f88213..d41a53c 100644
33
--- a/node_modules/react-contextmenu/modules/ContextMenu.js
44
+++ b/node_modules/react-contextmenu/modules/ContextMenu.js
55
@@ -81,6 +81,11 @@ var ContextMenu = function (_AbstractMenu) {
@@ -40,15 +40,15 @@ index 2f88213..150f93e 100644
4040
_this2.menu.style.opacity = 0;
4141
_this2.menu.style.pointerEvents = 'none';
4242
+
43-
+ if (this.previousFocus && this.previousFocus.focus) {
44-
+ this.previousFocus.focus();
45-
+ this.previousFocus = null;
43+
+ if (_this2.previousFocus && _this2.previousFocus.focus) {
44+
+ _this2.previousFocus.focus();
45+
+ _this2.previousFocus = null;
4646
+ }
4747
});
4848
}
4949
}
5050
diff --git a/node_modules/react-contextmenu/modules/SubMenu.js b/node_modules/react-contextmenu/modules/SubMenu.js
51-
index ad1dc70..ef0c960 100644
51+
index ad1dc70..4604898 100644
5252
--- a/node_modules/react-contextmenu/modules/SubMenu.js
5353
+++ b/node_modules/react-contextmenu/modules/SubMenu.js
5454
@@ -129,6 +129,7 @@ var SubMenu = function (_AbstractMenu) {
@@ -83,7 +83,7 @@ index ad1dc70..ef0c960 100644
8383
_this.state = (0, _objectAssign2.default)({}, _this.state, {
8484
visible: false
8585
});
86-
@@ -202,21 +213,24 @@ var SubMenu = function (_AbstractMenu) {
86+
@@ -202,32 +213,28 @@ var SubMenu = function (_AbstractMenu) {
8787
if (this.props.forceOpen || this.state.visible) {
8888
var wrapper = window.requestAnimationFrame || setTimeout;
8989
wrapper(function () {
@@ -122,11 +122,14 @@ index ad1dc70..ef0c960 100644
122122
+ }
123123
});
124124
} else {
125-
var cleanup = function cleanup() {
126-
@@ -227,7 +241,8 @@ var SubMenu = function (_AbstractMenu) {
127-
_this2.subMenu.style.left = '100%';
128-
_this2.unregisterHandlers();
129-
};
125+
- var cleanup = function cleanup() {
126+
- _this2.subMenu.removeEventListener('transitionend', cleanup);
127+
- _this2.subMenu.style.removeProperty('bottom');
128+
- _this2.subMenu.style.removeProperty('right');
129+
- _this2.subMenu.style.top = 0;
130+
- _this2.subMenu.style.left = '100%';
131+
- _this2.unregisterHandlers();
132+
- };
130133
- this.subMenu.addEventListener('transitionend', cleanup);
131134
+ this.subMenu.removeEventListener('transitionend', this.cleanup);
132135
+ this.subMenu.addEventListener('transitionend', this.cleanup);

0 commit comments

Comments
 (0)