aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-09-09 15:37:01 +0200
committerMarcel Klehr <mklehr@gmx.net>2024-09-11 09:14:42 +0200
commit0978631554e6d0c507de74861baca868d5cb5e5d (patch)
tree3a22b63122cc4bab17dabe31af10d5ef1a354055 /apps
parentef57270c5160dbd223a6bce508e469c81407ab3c (diff)
downloadnextcloud-server-0978631554e6d0c507de74861baca868d5cb5e5d.tar.gz
nextcloud-server-0978631554e6d0c507de74861baca868d5cb5e5d.zip
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>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/components/FileEntryMixin.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts
index 42a29455680..7a4f4e809f7 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -210,6 +210,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() {