diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-02-08 08:57:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 08:57:40 +0100 |
commit | 66bd27f5c6aa96eb7bf60904cb01fe98784330e9 (patch) | |
tree | febed87baf489ae8beb21ec252ca68fc5ebd9b99 /apps | |
parent | 3260a09b694990fcde18907cc7d4b4ea248c7ed7 (diff) | |
parent | 17c9f737a2d122c75aece365d58b04811bab4670 (diff) | |
download | nextcloud-server-66bd27f5c6aa96eb7bf60904cb01fe98784330e9.tar.gz nextcloud-server-66bd27f5c6aa96eb7bf60904cb01fe98784330e9.zip |
Merge pull request #42444 from nextcloud/fix/41877/files--move-focus-to-sidebar-on-open
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FileEntry/FileEntryActions.vue | 6 | ||||
-rw-r--r-- | apps/files/src/views/Sidebar.vue | 25 |
2 files changed, 21 insertions, 10 deletions
diff --git a/apps/files/src/components/FileEntry/FileEntryActions.vue b/apps/files/src/components/FileEntry/FileEntryActions.vue index c46990e971b..5dae3509f3b 100644 --- a/apps/files/src/components/FileEntry/FileEntryActions.vue +++ b/apps/files/src/components/FileEntry/FileEntryActions.vue @@ -35,7 +35,6 @@ <NcActions ref="actionsMenu" :boundaries-element="getBoundariesElement" :container="getBoundariesElement" - :disabled="isLoading || loading !== ''" :force-name="true" type="tertiary" :force-menu="enabledInlineActions.length === 0 /* forceMenu only if no inline actions */" @@ -272,6 +271,11 @@ export default Vue.extend({ }, async onActionClick(action, isSubmenu = false) { + // Skip click on loading + if (this.isLoading || this.loading !== '') { + return + } + // If the action is a submenu, we open it if (this.enabledSubmenuActions[action.id]) { this.openedSubmenu = action diff --git a/apps/files/src/views/Sidebar.vue b/apps/files/src/views/Sidebar.vue index 7b958aca312..88d32841c1e 100644 --- a/apps/files/src/views/Sidebar.vue +++ b/apps/files/src/views/Sidebar.vue @@ -25,7 +25,6 @@ ref="sidebar" v-bind="appSidebar" :force-menu="true" - tabindex="0" @close="close" @update:active="setActiveTab" @[defaultActionListener].stop.prevent="onDefaultAction" @@ -471,6 +470,10 @@ export default { throw new Error(`Invalid path '${path}'`) } + // Only focus the tab when the selected file/tab is changed in already opened sidebar + // Focusing the sidebar on first file open is handled by NcAppSidebar + const focusTabAfterLoad = !!this.Sidebar.file + // update current opened file this.Sidebar.file = path @@ -489,19 +492,23 @@ export default { view.setFileInfo(this.fileInfo) }) - this.$nextTick(() => { - if (this.$refs.tabs) { - this.$refs.tabs.updateTabs() - } - this.setActiveTab(this.Sidebar.activeTab || this.tabs[0].id) - }) + await this.$nextTick() + + this.setActiveTab(this.Sidebar.activeTab || this.tabs[0].id) + + this.loading = false + + await this.$nextTick() + + if (focusTabAfterLoad) { + this.$refs.sidebar.focusActiveTabContent() + } } catch (error) { + this.loading = false this.error = t('files', 'Error while loading the file data') console.error('Error while loading the file data', error) throw new Error(error) - } finally { - this.loading = false } }, |