diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-09 15:37:01 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-10 13:19:25 +0200 |
commit | 49c2d1819eedf9b1848b50c680690a26e435798b (patch) | |
tree | b5d41a22cd0e11764c6ff3c234e3baa3d13531ee /apps/files | |
parent | 225f7ecdb9bde40e6474dc6917a7f91db961b31f (diff) | |
download | nextcloud-server-49c2d1819eedf9b1848b50c680690a26e435798b.tar.gz nextcloud-server-49c2d1819eedf9b1848b50c680690a26e435798b.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')
-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() { |