Merge pull request #1669 from cryptpad/ctrl+e-modal-navigation-fixes

Disable arrow key navigation in the drive while modal is active
This commit is contained in:
yflory 2024-12-04 12:03:27 +01:00 committed by GitHub
commit 17c927d3d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -2525,6 +2525,7 @@ define([
window.setTimeout(function () {
modal.show();
$modal.focus();
next();
});
};

View File

@ -990,6 +990,9 @@ define([
// Arrow keys to modify the selection
var onWindowKeydown = function (e) {
if (!$content.is(':visible')) { return; }
if ($('.cp-modal').is(':visible')) {
return;
}
var $searchBar = $tree.find('#cp-app-drive-tree-search-input');
if (document.activeElement && document.activeElement.nodeName === 'INPUT') { return; }
if ($searchBar.is(':focus') && $searchBar.val()) { return; }