mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Fix composer focus when using message menu to reply in narrow widths
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/node_modules/react-contextmenu/modules/ContextMenu.js b/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||
index 2f88213..d41a53c 100644
|
||||
index 2f88213..4cf584a 100644
|
||||
--- a/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||
+++ b/node_modules/react-contextmenu/modules/ContextMenu.js
|
||||
@@ -81,6 +81,11 @@ var ContextMenu = function (_AbstractMenu) {
|
||||
@@ -35,12 +35,15 @@ index 2f88213..d41a53c 100644
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@@ -248,6 +259,11 @@ var ContextMenu = function (_AbstractMenu) {
|
||||
@@ -248,6 +259,14 @@ var ContextMenu = function (_AbstractMenu) {
|
||||
if (!_this2.menu) return;
|
||||
_this2.menu.style.opacity = 0;
|
||||
_this2.menu.style.pointerEvents = 'none';
|
||||
+
|
||||
+ if (_this2.previousFocus && _this2.previousFocus.focus) {
|
||||
+ // Return to the previous focus state when dismissing the menu, unless the
|
||||
+ // menu option focused another element. This is important for keyboard mode.
|
||||
+ var isFocusWithinMenu = _this2.menu.contains(document.activeElement);
|
||||
+ if (isFocusWithinMenu && _this2.previousFocus && _this2.previousFocus.focus) {
|
||||
+ _this2.previousFocus.focus();
|
||||
+ _this2.previousFocus = null;
|
||||
+ }
|
||||
@@ -48,7 +51,7 @@ index 2f88213..d41a53c 100644
|
||||
}
|
||||
}
|
||||
diff --git a/node_modules/react-contextmenu/modules/SubMenu.js b/node_modules/react-contextmenu/modules/SubMenu.js
|
||||
index ad1dc70..4604898 100644
|
||||
index ad1dc70..c919be8 100644
|
||||
--- a/node_modules/react-contextmenu/modules/SubMenu.js
|
||||
+++ b/node_modules/react-contextmenu/modules/SubMenu.js
|
||||
@@ -129,6 +129,7 @@ var SubMenu = function (_AbstractMenu) {
|
||||
|
||||
Reference in New Issue
Block a user