Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable25] Fix focussing to internal link after copy #34295

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions apps/files_sharing/src/components/SharingEntryInternal.vue
Original file line number Diff line number Diff line change
@@ -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'"
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion apps/files_sharing/src/components/SharingEntrySimple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.