diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index b89c5dcb3f437..8176762c63cb5 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -352,6 +352,15 @@ export default defineComponent({
return this.actionsMenuStore.opened === this.uniqueId
},
set(opened) {
+ // Only reset when opening a new menu
+ if (opened) {
+ // Reset any right click position override on close
+ // Wait for css animation to be done
+ const root = this.$root.$el as HTMLElement
+ root.style.removeProperty('--mouse-pos-x')
+ root.style.removeProperty('--mouse-pos-y')
+ }
+
this.actionsMenuStore.opened = opened ? this.uniqueId : null
},
},
@@ -389,6 +398,11 @@ export default defineComponent({
return
}
+ const root = this.$root.$el as HTMLElement
+ const contentRect = root.getBoundingClientRect()
+ root.style.setProperty('--mouse-pos-x', event.clientX - contentRect.left + 'px')
+ root.style.setProperty('--mouse-pos-y', event.clientY - contentRect.top + 'px')
+
// If the clicked row is in the selection, open global menu
const isMoreThanOneSelected = this.selectedFiles.length > 1
this.actionsMenuStore.opened = this.isSelected && isMoreThanOneSelected ? 'global' : this.uniqueId
diff --git a/apps/files/src/components/FileEntry/FileEntryActions.vue b/apps/files/src/components/FileEntry/FileEntryActions.vue
index d4693b7d8e64a..1e453fec70616 100644
--- a/apps/files/src/components/FileEntry/FileEntryActions.vue
+++ b/apps/files/src/components/FileEntry/FileEntryActions.vue
@@ -327,8 +327,24 @@ export default Vue.extend({
})
-
+