Fix composer focus when using message menu to reply in narrow widths

Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-12-09 18:03:22 -06:00 committed by GitHub
parent fe5e951155
commit 56b5f20cf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {