Skip to content

Commit

Permalink
Merge pull request #41580 from nextcloud/fix/a11y-replace_action_link…
Browse files Browse the repository at this point in the history
…_with_action_button

Replace ActionLink with ActionButton on sharing tab
  • Loading branch information
ShGKme authored Nov 17, 2023
2 parents 8c24a32 + ff2ef8d commit 8e3a08d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 18 deletions.
11 changes: 4 additions & 7 deletions apps/files_sharing/src/components/SharingEntryInternal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,25 @@
<div class="avatar-external icon-external-white" />
</template>

<NcActionLink :href="internalLink"
<NcActionButton :title="copyLinkTooltip"
:aria-label="copyLinkTooltip"
:title="copyLinkTooltip"
target="_blank"
:icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'"
@click.prevent="copyLink" />
@click="copyLink" />
</SharingEntrySimple>
</ul>
</template>

<script>
import { generateUrl } from '@nextcloud/router'
import { showSuccess } from '@nextcloud/dialogs'
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import SharingEntrySimple from './SharingEntrySimple.vue'
export default {
name: 'SharingEntryInternal',
components: {
NcActionLink,
NcActionButton,
SharingEntrySimple,
},
Expand Down Expand Up @@ -85,7 +83,6 @@ export default {
try {
await navigator.clipboard.writeText(this.internalLink)
showSuccess(t('files_sharing', 'Link copied'))
// focus and show the tooltip (note: cannot set ref on NcActionLink)
this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
this.copySuccess = true
this.copied = true
Expand Down
6 changes: 2 additions & 4 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@

<!-- clipboard -->
<NcActions v-if="share && !isEmailShareType && share.token" ref="copyButton" class="sharing-entry__copy">
<NcActionLink :href="shareLink"
target="_blank"
:title="copyLinkTooltip"
<NcActionButton :title="copyLinkTooltip"
:aria-label="copyLinkTooltip"
:icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'"
@click.stop.prevent="copyLink" />
@click.prevent="copyLink" />
</NcActions>
</div>

Expand Down
3 changes: 3 additions & 0 deletions dist/486-486.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/486-486.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/4997-4997.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/4997-4997.js.map

This file was deleted.

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.

0 comments on commit 8e3a08d

Please sign in to comment.