Merge pull request #34288 from nextcloud/bugfix/34281/fix-copy-internal-link-focus

Fix focussing to internal link after copy
pull/34306/head
Vincent Petry 2 years ago committed by GitHub
commit 5c8cab61ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,15 +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"
:href="internalLink"
<NcActionLink :href="internalLink"
:aria-label="t('files_sharing', 'Copy internal link to clipboard')"
target="_blank"
:icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'"
@ -84,8 +84,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) {

@ -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">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save