Skip to content

Commit

Permalink
fix: 🐛 ensure select all checkbox is announced correctly
Browse files Browse the repository at this point in the history
Select All Checkbox needs a label and state to be announced by screen
readers.
  • Loading branch information
marcelo-portugal authored and mportuga committed May 28, 2021
1 parent f9a84ff commit 3b478fa
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/js/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
previous: 'Previous Page',
last: 'Last Page'
},
selection: {
selectAll: 'Select All'
},
menu: {
text: 'Choose Columns:'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/es-ct.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
previous: 'Pàgina Anterior',
last: 'Última Pàgina'
},
selection: {
selectAll: 'Seleccionar Todo'
},
menu: {
text: 'Triar Columnes:'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
previous: 'Página Anterior',
last: 'Última Página'
},
selection: {
selectAll: 'Seleccionar Todo'
},
menu: {
text: 'Elegir columnas:'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
previous: 'Page précédente',
last: 'Dernière page'
},
selection: {
selectAll: 'Tout Sélectionner'
},
menu: {
text: 'Choisir des colonnes :'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
previous: 'Precedente',
last: 'Ultima'
},
selection: {
selectAll: 'Seleziona Tutto'
},
menu: {
text: 'Scegli le colonne:'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/pt-br.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
previous: 'Página Anterior',
last: 'Última Página'
},
selection: {
selectAll: 'Selecionar Tudo'
},
menu: {
text: 'Selecione as colunas:'
},
Expand Down
3 changes: 3 additions & 0 deletions packages/i18n/src/js/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
previous: 'Página Anterior',
last: 'Última Página'
},
selection: {
selectAll: 'Selecionar Tudo'
},
menu: {
text: 'Selecione as colunas:'
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div
role="button"
role="checkbox"
tabindex="0"
class="ui-grid-selection-row-header-buttons ui-grid-icon-ok"
ui-grid-one-bind-aria-label="'selection.selectAll' | t"
aria-checked="{{grid.selection.selectAll}}"
ng-class="{'ui-grid-all-selected': grid.selection.selectAll}"
ng-click="headerButtonClick($event)"
ng-keydown="headerButtonKeyDown($event)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('ui.grid.selection uiGridSelectionSelectAllButtons', function() {
it('should render the select all button', function() {
expect(selectAllButton.hasClass('ui-grid-selection-row-header-buttons')).toBe(true);
expect(selectAllButton.hasClass('ui-grid-icon-ok')).toBe(true);
expect(selectAllButton.attr('role')).toBe('button');
expect(selectAllButton.attr('role')).toBe('checkbox');
});
function testHeaderButtonAction(triggerAction) {
describe('when all of the rows are already selected', function() {
Expand Down

0 comments on commit 3b478fa

Please sign in to comment.