Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files): Reset context menu position on close
* Resolves #46934

Ensure that after a right-click the context menu position is resetted,
so that pressing the "actions"-menu button it is displayed on the correct location.

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Sep 10, 2024
commit 49c2d1819eedf9b1848b50c680690a26e435798b
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