diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts index 42a294556804d..7a4f4e809f7a4 100644 --- a/apps/files/src/components/FileEntryMixin.ts +++ b/apps/files/src/components/FileEntryMixin.ts @@ -210,6 +210,23 @@ export default defineComponent({ this.resetState() } }, + + openedMenu() { + if (this.openedMenu === false) { + // TODO: This timeout can be removed once `close` event only triggers after the transition + // ref: https://github.com/nextcloud-libraries/nextcloud-vue/pull/6065 + window.setTimeout(() => { + if (this.openedMenu) { + // was reopened while the animation run + return + } + // Reset any right menu position potentially set + const root = this.$el?.closest('main.app-content') as HTMLElement + root.style.removeProperty('--mouse-pos-x') + root.style.removeProperty('--mouse-pos-y') + }, 300) + } + }, }, beforeDestroy() {