Skip to content

Commit

Permalink
Merge pull request #47848 from nextcloud/fix/files-context-menu
Browse files Browse the repository at this point in the history
fix(files): Reset context menu position on close
  • Loading branch information
susnux authored Sep 10, 2024
2 parents 979cc87 + 4916551 commit 9dbf888
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions apps/files/src/components/FileEntryMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 9dbf888

Please sign in to comment.