Fix keyboard navigation in the drive

This commit is contained in:
yflory 2023-12-13 14:18:48 +01:00
parent c2627f7eeb
commit d25bd9ffc7

View File

@ -737,9 +737,6 @@ define([
var removeSelected = function (keepObj) {
APP.selectedFiles = [];
findSelectedElements().removeClass("cp-app-drive-element-selected");
var $container = $driveToolbar.find('#cp-app-drive-toolbar-contextbuttons');
if (!$container.length) { return; }
$container.html('');
if (!keepObj) {
delete sel.startSelected;
delete sel.endSelected;
@ -1043,6 +1040,11 @@ define([
if ([37, 38, 39, 40].indexOf(e.which) === -1) { return; }
e.preventDefault();
// If the arrow keys aren't caught by another listener before, it means we can
// use them to select content in the drive. If that's the case, we'll also
// focus the drive container to avoid conflicts with other focused elements
$content.focus();
var click = function (el) {
if (!el) { return; }
APP.onElementClick(ev, $(el));