Skip to content

Commit 973b615

Browse files
committed
fix(files): proper accessible row name and title for overflow
- resolves #59203 - resolves #56611 In the files list before this the accessible name of the button (default action) was overridden to the default action display name. But this causes problem for screen readers because then the whole table row is just called "view" or "download" instead of using the inner text (e.g. "filename.txt"). This fixes it to rename it `ACTION: FILENAME` instead. Also when long names were truncated there were no useful title (tooltip) for it, so it was not possible to get the real name. This is fixed by always provide a proper tooltip including the full name. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent d82ba61 commit 973b615

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

apps/files/src/components/FileEntry/FileEntryName.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default defineComponent({
136136
return {
137137
is: 'span',
138138
params: {
139-
title: t('files', 'This node is unavailable'),
139+
title: this.source.displayname + ` (${t('files', 'unavailable')})`,
140140
},
141141
}
142142
}
@@ -148,11 +148,12 @@ export default defineComponent({
148148
folder: this.activeFolder!,
149149
contents: [],
150150
})
151+
const accessibleName = `${displayName}: ${this.source.displayname}`
151152
return {
152153
is: 'button',
153154
params: {
154-
'aria-label': displayName,
155-
title: displayName,
155+
'aria-label': accessibleName,
156+
title: accessibleName,
156157
tabindex: '0',
157158
},
158159
}

cypress/e2e/files_external/files-external-failed.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
4848
// Ensure the row is visible and marked as unavailable
4949
getRowForFile('Storage1').as('row').should('be.visible')
5050
cy.get('@row').find('[data-cy-files-list-row-name-link]')
51-
.should('have.attr', 'title', 'This node is unavailable')
51+
.should('have.attr', 'title', / \(unavailable\)$/)
5252

5353
// Ensure clicking on the location does not open the folder
5454
cy.location().then((loc) => {
@@ -74,7 +74,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
7474
// Ensure the row is visible and marked as unavailable
7575
getRowForFile('Storage2').as('row').should('be.visible')
7676
cy.get('@row').find('[data-cy-files-list-row-name-link]')
77-
.should('have.attr', 'title', 'This node is unavailable')
77+
.should('have.attr', 'title', / \(unavailable\)$/)
7878

7979
// Ensure clicking on the location does not open the folder
8080
cy.location().then((loc) => {

0 commit comments

Comments
 (0)