Skip to content

Commit f211e9a

Browse files
Merge pull request #45666 from nextcloud/backport/45581/stable29
[stable29] fix(files): reset menu pos when opening in grid mode
2 parents 97f1040 + 2024d99 commit f211e9a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

apps/files/src/components/FileEntryMixin.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,6 @@ export default defineComponent({
157157
return this.actionsMenuStore.opened === this.uniqueId.toString()
158158
},
159159
set(opened) {
160-
// Only reset when opening a new menu
161-
if (opened) {
162-
// Reset any right click position override on close
163-
// Wait for css animation to be done
164-
const root = this.$el?.closest('main.app-content') as HTMLElement
165-
root.style.removeProperty('--mouse-pos-x')
166-
root.style.removeProperty('--mouse-pos-y')
167-
}
168-
169160
this.actionsMenuStore.opened = opened ? this.uniqueId.toString() : null
170161
},
171162
},
@@ -216,6 +207,11 @@ export default defineComponent({
216207
// 200 = max width of the menu
217208
root.style.setProperty('--mouse-pos-x', Math.max(0, event.clientX - contentRect.left - 200) + 'px')
218209
root.style.setProperty('--mouse-pos-y', Math.max(0, event.clientY - contentRect.top) + 'px')
210+
} else {
211+
// Reset any right menu position potentially set
212+
const root = this.$el?.closest('main.app-content') as HTMLElement
213+
root.style.removeProperty('--mouse-pos-x')
214+
root.style.removeProperty('--mouse-pos-y')
219215
}
220216

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

dist/files-main.js

Lines changed: 2 additions & 2 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)