From 31a68bbb77607149bbd5cb53d587e8e8cec2d2d6 Mon Sep 17 00:00:00 2001 From: Matteo <193476828+mzner@users.noreply.github.com> Date: Fri, 31 Jul 2026 16:12:06 +0000 Subject: [PATCH] fix(web): focus New/Upload dropdown menus on open (#12698) The New and Upload button dropdowns did not receive focus when opened, so arrow key navigation between menu items didn't work, unlike the context menu. --- .../bugfix-new-upload-dropdown-keyboard-navigation.md | 9 +++++++++ .../src/components/AppBar/CreateAndUpload.vue | 2 ++ .../AppBar/__snapshots__/CreateAndUpload.spec.ts.snap | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/bugfix-new-upload-dropdown-keyboard-navigation.md diff --git a/changelog/unreleased/bugfix-new-upload-dropdown-keyboard-navigation.md b/changelog/unreleased/bugfix-new-upload-dropdown-keyboard-navigation.md new file mode 100644 index 00000000000..1cb86cd1deb --- /dev/null +++ b/changelog/unreleased/bugfix-new-upload-dropdown-keyboard-navigation.md @@ -0,0 +1,9 @@ +Bugfix: Fix keyboard navigation in "New" and "Upload" dropdown menus + +Opening the "New" or "Upload" dropdown menu in the Files app toolbar did +not move focus into the menu, so pressing the arrow keys had no effect +on the highlighted item, unlike the existing right-click context menu. +Both dropdowns now focus their first item on open, restoring arrow key +navigation. + +https://github.com/owncloud/ocis/pull/12646 diff --git a/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue b/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue index 9c94a045fe1..5063d14ef8a 100644 --- a/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue +++ b/web/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue @@ -21,6 +21,7 @@ class="oc-width-auto" mode="click" close-on-click + focus-on-open padding-size="small" > @@ -121,6 +122,7 @@ mode="click" class="oc-width-auto" close-on-click + focus-on-open padding-size="small" @show-drop="showDrop" > diff --git a/web/packages/web-app-files/tests/unit/components/AppBar/__snapshots__/CreateAndUpload.spec.ts.snap b/web/packages/web-app-files/tests/unit/components/AppBar/__snapshots__/CreateAndUpload.spec.ts.snap index 390e2aa8a45..4d362d16acb 100644 --- a/web/packages/web-app-files/tests/unit/components/AppBar/__snapshots__/CreateAndUpload.spec.ts.snap +++ b/web/packages/web-app-files/tests/unit/components/AppBar/__snapshots__/CreateAndUpload.spec.ts.snap @@ -2,7 +2,7 @@ exports[`CreateAndUpload component > action buttons > should show and be enabled if file creation is possible 1`] = ` "
- +
  • @@ -19,7 +19,7 @@ exports[`CreateAndUpload component > action buttons > should show and be enabled exports[`CreateAndUpload component > file handlers > should show entries for all new file handlers 1`] = ` "
    - +