File tree Expand file tree Collapse file tree
apps/files/src/components/FileEntry Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 <!-- Default actions list-->
4646 <NcActionButton v-for =" action in enabledMenuActions"
4747 :key =" action.id"
48+ :ref =" `action-${action.id}`"
4849 :class =" {
4950 [`files-list__row-action-${action.id}`]: true,
5051 [`files-list__row-action--menu`]: isMenu(action.id)
6465 <!-- Submenu actions list-->
6566 <template v-if =" openedSubmenu && enabledSubmenuActions [openedSubmenu ?.id ]" >
6667 <!-- Back to top-level button -->
67- <NcActionButton class =" files-list__row-action-back" @click =" openedSubmenu = null " >
68+ <NcActionButton class =" files-list__row-action-back" @click =" onBackToMenuClick( openedSubmenu) " >
6869 <template #icon >
6970 <ArrowLeftIcon />
7071 </template >
@@ -322,6 +323,21 @@ export default Vue.extend({
322323 return this .enabledSubmenuActions [id ]?.length > 0
323324 },
324325
326+ async onBackToMenuClick(action : FileAction ) {
327+ this .openedSubmenu = null
328+ // Wait for first render
329+ await this .$nextTick ()
330+
331+ // Focus the previous menu action button
332+ this .$nextTick (() => {
333+ // Focus the action button
334+ const menuAction = this .$refs [` action-${action .id } ` ][0 ]
335+ if (menuAction ) {
336+ menuAction .$el .querySelector (' button' )?.focus ()
337+ }
338+ })
339+ },
340+
325341 t ,
326342 },
327343})
You can’t perform that action at this time.
0 commit comments