mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix(files): Reset context menu position on close
* Resolves https://github.com/nextcloud/server/issues/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 <opensource@fthiessen.de>
This commit is contained in:
parent
225f7ecdb9
commit
49c2d1819e
1 changed files with 17 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue