@@ -941,24 +941,30 @@ export default {
941941 this.nextFile.failed = true
942942 },
943943
944+ takeSidebarPosition() {
945+ const sidebarElement = document.querySelector('aside.app-sidebar')
946+ this.sidebarPosition = sidebarElement?.getBoundingClientRect().left
947+ },
948+
944949 /**
945950 * Show the sharing sidebar
946951 */
947-
948952 async showSidebar() {
949953 // Open the sidebar sharing tab
950954 // TODO: also hide figure, needs a proper method for it in server Sidebar
951-
952955 if (OCA?.Files?.Sidebar) {
953956 await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)
957+ // If OCA.Files.Sidebar has isFullScreenMode on, the sidebar is moved only after file loading
958+ // So we need to take its new position after the loading
959+ this.takeSidebarPosition()
954960 }
955961 },
956962
957963 handleAppSidebarOpen() {
958964 this.isSidebarShown = true
965+ this.takeSidebarPosition()
959966 const sidebar = document.querySelector('aside.app-sidebar')
960967 if (sidebar) {
961- this.sidebarPosition = sidebar.getBoundingClientRect().left
962968 this.trapElements = [sidebar]
963969 }
964970 },
@@ -969,10 +975,7 @@ export default {
969975 },
970976
971977 onResize() {
972- const sidebar = document.querySelector('aside.app-sidebar')
973- if (sidebar) {
974- this.sidebarPosition = sidebar.getBoundingClientRect().left
975- }
978+ this.takeSidebarPosition()
976979 },
977980
978981 async onDelete() {
0 commit comments