diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-09 15:37:01 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2024-09-11 09:15:41 +0200 |
commit | 2a5d6bb713d51be5938d8e220fb33f65eeb7e529 (patch) | |
tree | 8bc0d19597d68d196d089258c482fefa747edb4b /apps/files/src | |
parent | 87605dd358dba3c2b4806e9a2dad45c6fd5441bd (diff) | |
download | nextcloud-server-2a5d6bb713d51be5938d8e220fb33f65eeb7e529.tar.gz nextcloud-server-2a5d6bb713d51be5938d8e220fb33f65eeb7e529.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.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 6806af6fadc..94a83d562b0 100644 --- a/apps/files/src/components/FileEntryMixin.ts +++ b/apps/files/src/components/FileEntryMixin.ts @@ -211,6 +211,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() { |