diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-10 18:13:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-10 18:13:13 +0200 |
commit | 9dbf88816c8fe985d62507bd45c364e760d8ce72 (patch) | |
tree | f3c531629096f208fd5181197f43b072db79006f /apps | |
parent | 979cc8712cfe090d01508a8cd56eca04e2d9f1c8 (diff) | |
parent | 4916551c57d7a8ed2a8b156f07c82ddb89f9a320 (diff) | |
download | nextcloud-server-9dbf88816c8fe985d62507bd45c364e760d8ce72.tar.gz nextcloud-server-9dbf88816c8fe985d62507bd45c364e760d8ce72.zip |
Merge pull request #47848 from nextcloud/fix/files-context-menu
fix(files): Reset context menu position on close
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/components/FileEntryMixin.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/src/components/FileEntryMixin.ts b/apps/files/src/components/FileEntryMixin.ts index 58f5c1e9474..83d0e460942 100644 --- a/apps/files/src/components/FileEntryMixin.ts +++ b/apps/files/src/components/FileEntryMixin.ts @@ -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() { |