Skip to content

Commit 9fcd5f6

Browse files
authored
Merge pull request #42487 from nextcloud/backport/42379/fix/ARIA-prop-for-NcBreadCrumbs-component
2 parents e279d45 + 40ee6ce commit 9fcd5f6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

apps/files/src/components/BreadCrumbs.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<template>
2-
<NcBreadcrumbs data-cy-files-content-breadcrumbs>
2+
<NcBreadcrumbs
3+
data-cy-files-content-breadcrumbs
4+
:aria-label="t('files', 'Current directory path')">
35
<!-- Current path sections -->
46
<NcBreadcrumb v-for="(section, index) in sections"
57
:key="section.dir"
6-
:aria-label="ariaLabel(section)"
7-
:title="ariaLabel(section)"
88
v-bind="section"
9+
dir="auto"
10+
:to="section.to"
11+
:title="titleForSection(section)"
912
@click.native="onClick(section.to)">
1013
<template v-if="index === 0" #icon>
11-
<Home :size="20" />
14+
<Home :size="20"/>
1215
</template>
1316
</NcBreadcrumb>
1417

@@ -20,6 +23,7 @@
2023
</template>
2124

2225
<script>
26+
import { translate as t} from '@nextcloud/l10n'
2327
import { basename } from 'path'
2428
import Home from 'vue-material-design-icons/Home.vue'
2529
import NcBreadcrumb from '@nextcloud/vue/dist/Components/NcBreadcrumb.js'
@@ -104,12 +108,14 @@ export default Vue.extend({
104108
}
105109
},
106110
107-
ariaLabel(section) {
111+
titleForSection(section) {
108112
if (section?.to?.query?.dir === this.$route.query.dir) {
109113
return t('files', 'Reload current directory')
110114
}
111115
return t('files', 'Go to the "{dir}" directory', section)
112116
},
117+
118+
t,
113119
},
114120
})
115121
</script>

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)