aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-09-09 15:37:01 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-10-17 14:27:30 +0200
commitbe33321059ac93e81d79e0d87c126575b839ac6b (patch)
tree83a1d85b5e0822ce91b4f59d1b24105b6a89e3c1 /apps/files/src
parentfd746c69f4e5122aebe3e136837473a60fccd3b3 (diff)
downloadnextcloud-server-be33321059ac93e81d79e0d87c126575b839ac6b.tar.gz
nextcloud-server-be33321059ac93e81d79e0d87c126575b839ac6b.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/files/src')
-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 f2a6f89cf22..a43cab13575 100644
--- a/apps/files/src/components/FileEntryMixin.ts
+++ b/apps/files/src/components/FileEntryMixin.ts
@@ -218,6 +218,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() {