diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-09-27 12:25:22 +0200 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-09-27 12:25:22 +0200 |
commit | 64a4abf472f6e8c7c674c62601b21089d4580553 (patch) | |
tree | 11fd589d50436cce6037947c3b3c755e0298c480 /apps/files_sharing/src/components | |
parent | 0e41530b807244e213e3e2566c0ffe30ed809a32 (diff) | |
download | nextcloud-server-64a4abf472f6e8c7c674c62601b21089d4580553.tar.gz nextcloud-server-64a4abf472f6e8c7c674c62601b21089d4580553.zip |
Fix focussing to internal link after copy
Since a recent change to NcActions it's not possible to add a "ref"
attribute on a NcAction* component.
As a workaround, a ref was added on the NcActions parent component
instead.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/src/components')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryInternal.vue | 9 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntrySimple.vue | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryInternal.vue b/apps/files_sharing/src/components/SharingEntryInternal.vue index 468275aac2c..57bafa13c46 100644 --- a/apps/files_sharing/src/components/SharingEntryInternal.vue +++ b/apps/files_sharing/src/components/SharingEntryInternal.vue @@ -1,14 +1,15 @@ <template> <ul> - <SharingEntrySimple class="sharing-entry__internal" + <SharingEntrySimple ref="shareEntrySimple" + class="sharing-entry__internal" :title="t('files_sharing', 'Internal link')" :subtitle="internalLinkSubtitle"> <template #avatar> <div class="avatar-external icon-external-white" /> </template> - <NcActionLink ref="copyButton" + <NcActionLink :href="internalLink" :aria-label="t('files_sharing', 'Copy internal link to clipboard')" target="_blank" @@ -84,8 +85,8 @@ export default { async copyLink() { try { await this.$copyText(this.internalLink) - // focus and show the tooltip - this.$refs.copyButton.$el.focus() + // focus and show the tooltip (note: cannot set ref on NcActionLink) + this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus() this.copySuccess = true this.copied = true } catch (error) { diff --git a/apps/files_sharing/src/components/SharingEntrySimple.vue b/apps/files_sharing/src/components/SharingEntrySimple.vue index 8b495b0743c..0a0f86cd530 100644 --- a/apps/files_sharing/src/components/SharingEntrySimple.vue +++ b/apps/files_sharing/src/components/SharingEntrySimple.vue @@ -29,7 +29,8 @@ {{ subtitle }} </p> </div> - <NcActions v-if="$slots['default']" + <NcActions ref="actionsComponent" + v-if="$slots['default']" class="sharing-entry__actions" menu-align="right" :aria-expanded="ariaExpandedValue"> |