Merge pull request #47848 from nextcloud/fix/files-context-menu

fix(files): Reset context menu position on close
This commit is contained in:
Ferdinand Thiessen 2024-09-10 18:13:13 +02:00 committed by GitHub
commit 9dbf88816c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 3 deletions

View file

@ -220,6 +220,23 @@ export default defineComponent({
this.resetState()
}
},
openedMenu() {
if (this.openedMenu === false) {
// TODO: This timeout can be removed once `close` event only triggers after the transition
// ref: https://github.com/nextcloud-libraries/nextcloud-vue/pull/6065
window.setTimeout(() => {
if (this.openedMenu) {
// was reopened while the animation run
return
}
// Reset any right menu position potentially set
const root = this.$el?.closest('main.app-content') as HTMLElement
root.style.removeProperty('--mouse-pos-x')
root.style.removeProperty('--mouse-pos-y')
}, 300)
}
},
},
beforeDestroy() {

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long