Skip to content

Commit dc86dd2

Browse files
committed
fix(files): reset menu pos when opening in grid mode
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent b8856e2 commit dc86dd2

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

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

0 commit comments

Comments
 (0)