Skip to content

Commit 8500f0d

Browse files
authored
Merge pull request #47876 from nextcloud/backport/47848/stable28
[stable28] fix(files): Reset context menu position on close
2 parents 1e0ecc4 + 263a381 commit 8500f0d

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

apps/files/src/components/FileEntryMixin.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,25 @@ export default defineComponent({
210210
this.resetState()
211211
}
212212
},
213+
214+
openedMenu() {
215+
if (this.openedMenu === false) {
216+
// TODO: This timeout can be removed once `close` event only triggers after the transition
217+
// ref: https://github.com/nextcloud-libraries/nextcloud-vue/pull/6065
218+
window.setTimeout(() => {
219+
if (this.openedMenu) {
220+
// was reopened while the animation run
221+
return
222+
}
223+
// Reset any right menu position potentially set
224+
const root = document.getElementById('app-content-vue')
225+
if (root !== null) {
226+
root.style.removeProperty('--mouse-pos-x')
227+
root.style.removeProperty('--mouse-pos-y')
228+
}
229+
}, 300)
230+
}
231+
},
213232
},
214233

215234
beforeDestroy() {

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)