Skip to content

Commit 98da220

Browse files
authored
Merge pull request #4335 from alexandrevryghem/w2p-130479_fix-accessibility-issues-for-the-language-toggle-and-recent-submissions_contribute-main
Improve accessibility for screen readers
2 parents ebd69c0 + aba3a94 commit 98da220

File tree

36 files changed

+155
-109
lines changed

36 files changed

+155
-109
lines changed

cypress/e2e/header.cy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ describe('Header', () => {
1515
cy.visit('/');
1616

1717
// Click the language switcher (globe) in header
18-
cy.get('a[data-test="lang-switch"]').click();
18+
cy.get('button[data-test="lang-switch"]').click();
1919
// Click on the "Deusch" language in dropdown
20-
cy.get('#language-menu-list li').contains('Deutsch').click();
20+
cy.get('#language-menu-list div[role="option"]').contains('Deutsch').click();
2121

2222
// HTML "lang" attribute should switch to "de"
2323
cy.get('html').invoke('attr', 'lang').should('eq', 'de');
2424

2525
// Login menu should now be in German
26-
cy.get('a[data-test="login-menu"]').contains('Anmelden');
26+
cy.get('[data-test="login-menu"]').contains('Anmelden');
2727

2828
// Change back to English from language switcher
29-
cy.get('a[data-test="lang-switch"]').click();
30-
cy.get('#language-menu-list li').contains('English').click();
29+
cy.get('button[data-test="lang-switch"]').click();
30+
cy.get('#language-menu-list div[role="option"]').contains('English').click();
3131

3232
// HTML "lang" attribute should switch to "en"
3333
cy.get('html').invoke('attr', 'lang').should('eq', 'en');
3434

3535
// Login menu should now be in English
36-
cy.get('a[data-test="login-menu"]').contains('Log In');
36+
cy.get('[data-test="login-menu"]').contains('Log In');
3737
});
3838
});

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-issue/journal-issue-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-issue/journal-issue-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@if (linkType !== linkTypes.None) {
55
<a [target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
66
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
7-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
7+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" tabindex="-1">
88
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
99
</ds-thumbnail>
1010
</a>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal-volume/journal-volume-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@if (linkType !== linkTypes.None) {
55
<a [target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
66
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
7-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
7+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" tabindex="-1">
88
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
99
</ds-thumbnail>
1010
</a>

src/app/entity-groups/journal-entities/item-list-elements/search-result-list-elements/journal/journal-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="col-3 col-md-2">
44
@if (linkType !== linkTypes.None) {
55
<a [target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'" [attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null"
6-
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" role="link" tabindex="0">
6+
[routerLink]="[itemPageRoute]" class="lead item-list-title dont-break-out" tabindex="-1">
77
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="true">
88
</ds-thumbnail>
99
</a>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/org-unit/org-unit-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/person/person-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a
88
[target]="(linkType === linkTypes.ExternalLink) ? '_blank' : '_self'"
99
[attr.rel]="(linkType === linkTypes.ExternalLink) ? 'noopener noreferrer' : null" [routerLink]="[itemPageRoute]"
10-
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" role="link" tabindex="0">
10+
class="card-img-top full-width" [attr.title]="'search.results.view-result' | translate" tabindex="-1">
1111
<div>
1212
<ds-thumbnail [thumbnail]="dso?.thumbnail | async" [limitWidth]="false">
1313
</ds-thumbnail>

0 commit comments

Comments
 (0)