Merge pull request #41978 from nextcloud/backport/41953/stable28

[stable28] fix(files): Move aria-label for favorite icon from span to icon
This commit is contained in:
Ferdinand Thiessen 2023-12-03 17:28:38 +01:00 committed by GitHub
commit 41ece3b55c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 13 deletions

View file

@ -20,10 +20,13 @@
-
-->
<template>
<NcIconSvgWrapper class="favorite-marker-icon" :svg="StarSvg" />
<NcIconSvgWrapper class="favorite-marker-icon" :name="t('files', 'Favorite')" :svg="StarSvg" />
</template>
<script>
<script lang="ts">
import { translate as t } from '@nextcloud/l10n'
import { defineComponent } from 'vue'
import StarSvg from '@mdi/svg/svg/star.svg?raw'
import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
@ -38,7 +41,7 @@ import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js
* }
* ```
*/
export default {
export default defineComponent({
name: 'FavoriteIcon',
components: {
NcIconSvgWrapper,
@ -52,10 +55,14 @@ export default {
await this.$nextTick()
// MDI default viewbox is "0 0 24 24" but we add a stroke of 10px so we must adjust it
const el = this.$el.querySelector('svg')
el.setAttribute('viewBox', '-4 -4 30 30')
el?.setAttribute?.('viewBox', '-4 -4 30 30')
},
}
methods: {
t,
},
})
</script>
<style lang="scss" scoped>
.favorite-marker-icon {
color: #a08b00;

View file

@ -22,7 +22,7 @@
<template>
<span class="files-list__row-icon">
<template v-if="source.type === 'folder'">
<FolderOpenIcon v-once v-if="dragover" />
<FolderOpenIcon v-if="dragover" v-once />
<template v-else>
<FolderIcon v-once />
<OverlayIcon :is="folderOverlay"
@ -42,12 +42,10 @@
@error="backgroundFailed = true"
@load="backgroundFailed = false">
<FileIcon v-once v-else />
<FileIcon v-else v-once />
<!-- Favorite icon -->
<span v-if="isFavorite"
class="files-list__row-icon-favorite"
:aria-label="t('files', 'Favorite')">
<span v-if="isFavorite" class="files-list__row-icon-favorite">
<FavoriteIcon v-once />
</span>

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long