From 08d3ac0036546896c84f3267ea6f1a98304906ff Mon Sep 17 00:00:00 2001 From: daria Date: Wed, 28 Aug 2024 16:07:07 +0300 Subject: [PATCH] add tabindex to `+New` button fix #1609 --- www/common/drive-ui.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 3e3cf45f1..135b0eae0 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -3568,7 +3568,8 @@ define([ if (APP.$content.data('readOnlyFolder') || !APP.editable) { return; } var isInRoot = currentPath[0] === ROOT; var $element = $('
  • ', { - 'class': 'cp-app-drive-element-row cp-app-drive-new-ghost' + 'class': 'cp-app-drive-element-row cp-app-drive-new-ghost', + 'tabindex': 0 }).prepend($addIcon.clone()).appendTo($list); $element.append($('', {'class': 'cp-app-drive-element-name'}) .text(Messages.fm_newButton)); @@ -3587,6 +3588,12 @@ define([ window.setTimeout(function () { modal.show(); }); addNewPadHandlers($modal, isInRoot); }); + $element.keydown(function(){ + if (event.which === 13) { + event.stopPropagation(); + $element.click(); + } + }); }; // Drive content toolbar