Skip to content

Commit 3f77eb0

Browse files
authored
Merge pull request #45581 from nextcloud/fix/grid-view-contextmenu-pos
2 parents 57cd95f + 4383055 commit 3f77eb0

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

apps/files/src/components/FileEntryMixin.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,6 @@ export default defineComponent({
139139
return this.actionsMenuStore.opened === this.uniqueId.toString()
140140
},
141141
set(opened) {
142-
// Only reset when opening a new menu
143-
if (opened) {
144-
// Reset any right click position override on close
145-
// Wait for css animation to be done
146-
const root = this.$el?.closest('main.app-content') as HTMLElement
147-
root.style.removeProperty('--mouse-pos-x')
148-
root.style.removeProperty('--mouse-pos-y')
149-
}
150-
151142
this.actionsMenuStore.opened = opened ? this.uniqueId.toString() : null
152143
},
153144
},
@@ -198,6 +189,11 @@ export default defineComponent({
198189
// 200 = max width of the menu
199190
root.style.setProperty('--mouse-pos-x', Math.max(0, event.clientX - contentRect.left - 200) + 'px')
200191
root.style.setProperty('--mouse-pos-y', Math.max(0, event.clientY - contentRect.top) + 'px')
192+
} else {
193+
// Reset any right menu position potentially set
194+
const root = this.$el?.closest('main.app-content') as HTMLElement
195+
root.style.removeProperty('--mouse-pos-x')
196+
root.style.removeProperty('--mouse-pos-y')
201197
}
202198

203199
// If the clicked row is in the selection, open global menu

dist/files-main.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)