From 02f28508179f80256b349b080090ee5e3b6ec54a Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Wed, 8 Nov 2023 11:07:10 +0100 Subject: fix(files): make sure we focus the parent actions submenu entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .../src/components/FileEntry/FileEntryActions.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'apps/files/src/components/FileEntry/FileEntryActions.vue') diff --git a/apps/files/src/components/FileEntry/FileEntryActions.vue b/apps/files/src/components/FileEntry/FileEntryActions.vue index 1e453fec706..d9d8cefdbad 100644 --- a/apps/files/src/components/FileEntry/FileEntryActions.vue +++ b/apps/files/src/components/FileEntry/FileEntryActions.vue @@ -45,6 +45,7 @@ - + @@ -322,6 +323,21 @@ export default Vue.extend({ return this.enabledSubmenuActions[id]?.length > 0 }, + async onBackToMenuClick(action: FileAction) { + this.openedSubmenu = null + // Wait for first render + await this.$nextTick() + + // Focus the previous menu action button + this.$nextTick(() => { + // Focus the action button + const menuAction = this.$refs[`action-${action.id}`][0] + if (menuAction) { + menuAction.$el.querySelector('button')?.focus() + } + }) + }, + t, }, }) -- cgit v1.2.3