From 630527faba40650f7ea1191bee0c56fb42b5800f Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 3 Nov 2025 15:53:28 +0100 Subject: [PATCH 1/3] fix: only render drop content when drop gets opened This fixes a small UI glitch when closing the file context menu and an unwanted displacement of the table header row in certain edge cases. (cherry picked from commit 39c9ab01fc304380094bcfad1236299096a35346) --- .../src/components/OcDrop/OcDrop.vue | 26 +++++++++---------- .../src/components/Search/List.vue | 4 +-- .../components/Shares/SharedWithMeSection.vue | 4 +-- .../web-app-files/src/views/Favorites.vue | 4 +-- .../src/views/shares/SharedViaLink.vue | 4 +-- .../src/views/shares/SharedWithOthers.vue | 4 +-- .../src/views/spaces/GenericSpace.vue | 4 +-- .../src/views/spaces/GenericTrash.vue | 4 +-- .../src/views/spaces/Projects.vue | 4 +-- .../src/views/trash/Overview.vue | 3 +-- .../ContextActions/ContextMenuQuickAction.vue | 10 +++---- .../src/components/CreateShortcutModal.vue | 17 ++++++------ .../components/FilesList/ResourceTable.vue | 4 +-- .../components/FilesList/ResourceTiles.vue | 6 ++--- 14 files changed, 47 insertions(+), 51 deletions(-) diff --git a/packages/design-system/src/components/OcDrop/OcDrop.vue b/packages/design-system/src/components/OcDrop/OcDrop.vue index a82fdec415..0a9f3cc1bd 100644 --- a/packages/design-system/src/components/OcDrop/OcDrop.vue +++ b/packages/design-system/src/components/OcDrop/OcDrop.vue @@ -13,10 +13,10 @@
- + - +
@@ -140,6 +140,7 @@ const emit = defineEmits() defineSlots() const { isMobile } = useIsMobile() +const isOpen = ref(false) const useBottomDrawer = computed(() => unref(isMobile) && !enforceDropOnMobile) const bottomDrawerRef = useTemplateRef('bottomDrawerRef') @@ -182,10 +183,6 @@ const onFocusOut = (event: FocusEvent) => { } } -onBeforeUnmount(() => { - drop.value?.removeEventListener('focusout', onFocusOut) -}) - const triggerMapping = computed(() => { return ( { @@ -211,6 +208,7 @@ watch( ) onBeforeUnmount(() => { + unref(drop)?.removeEventListener('focusout', onFocusOut) destroy(unref(tippyInstance)) }) @@ -236,15 +234,17 @@ const initializeTippy = () => { theme: 'none', maxWidth: 416, offset, - ...(!isNestedElement && { - onShow: (instance) => { - emit('showDrop') + onShow: (instance) => { + isOpen.value = true + emit('showDrop') + if (!isNestedElement) { hideAll({ exclude: instance }) - }, - onHide: () => { - emit('hideDrop') } - }), + }, + onHide: () => { + isOpen.value = false + emit('hideDrop') + }, popperOptions: { ...popperOptions, modifiers: [ diff --git a/packages/web-app-files/src/components/Search/List.vue b/packages/web-app-files/src/components/Search/List.vue index 2b53ef2bc5..fda0d129e1 100644 --- a/packages/web-app-files/src/components/Search/List.vue +++ b/packages/web-app-files/src/components/Search/List.vue @@ -114,9 +114,9 @@ /> -