diff --git a/test/accessibility.html b/test/accessibility.html new file mode 100644 index 000000000..1fe191275 --- /dev/null +++ b/test/accessibility.html @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/index.html b/test/index.html index 4ff6d2109..0bddb5ef2 100644 --- a/test/index.html +++ b/test/index.html @@ -18,6 +18,7 @@ diff --git a/vaadin-grid-column-group.html b/vaadin-grid-column-group.html index 061aa0510..c3df8c740 100644 --- a/vaadin-grid-column-group.html +++ b/vaadin-grid-column-group.html @@ -232,9 +232,11 @@ _colSpanChanged(colSpan, headerCell, footerCell) { if (headerCell) { headerCell.setAttribute('colspan', colSpan); + this._grid && this._grid._a11yUpdateCellColspan(headerCell, colSpan); } if (footerCell) { footerCell.setAttribute('colspan', colSpan); + this._grid && this._grid._a11yUpdateCellColspan(footerCell, colSpan); } } diff --git a/vaadin-grid-column-reordering-mixin.html b/vaadin-grid-column-reordering-mixin.html index a7afc5354..f4edf54be 100644 --- a/vaadin-grid-column-reordering-mixin.html +++ b/vaadin-grid-column-reordering-mixin.html @@ -202,15 +202,7 @@ _updateGhost(cell) { const ghost = this._reorderGhost; - const sorter = cell._content.querySelector('vaadin-grid-sorter'); - if (sorter) { - // Hide sorter announcer text - sorter.$.announcer.hidden = true; - } ghost.textContent = cell._content.innerText; - if (sorter) { - sorter.$.announcer.hidden = false; - } const style = window.getComputedStyle(cell); ['boxSizing', 'display', 'width', 'height', 'background', 'alignItems', 'padding', 'border', 'flex-direction', 'overflow'] .forEach(propertyName => ghost.style[propertyName] = style[propertyName]); diff --git a/vaadin-grid-selection-mixin.html b/vaadin-grid-selection-mixin.html index 3c4cc25dc..e86a35235 100644 --- a/vaadin-grid-selection-mixin.html +++ b/vaadin-grid-selection-mixin.html @@ -32,29 +32,6 @@ ]; } - ready() { - super.ready(); - this.addEventListener('template-instance-changed', this._templateInstanceChangedSelection.bind(this)); - } - - _templateInstanceChangedSelection(e) { - if (e.detail.prop === 'selected') { - const item = e.detail.inst.item; - (this._isSelected(item) ? this.deselectItem : this.selectItem).call(this, item); - - this.dispatchEvent(new CustomEvent('iron-announce', { - bubbles: true, - composed: true, - detail: { - text: (this._isSelected(item) ? 'Selected' : 'Deselected') + ' Row ' + (e.detail.inst.index + 1) + ' of ' + this.size - } - })); - - // stop this internal event from propagating outside. - e.stopPropagation(); - } - } - _isSelected(item) { return this.selectedItems && this.selectedItems.indexOf(item) > -1; } @@ -117,13 +94,7 @@ _selectedItemsChanged(e) { if (this.$.items.children.length && (e.path === 'selectedItems' || e.path === 'selectedItems.splices')) { Array.from(this.$.items.children).forEach(row => { - const selected = this._isSelected(row._item); - this._toggleAttribute('selected', selected, row); - Array.from(row.children).forEach(cell => { - if (cell._instance) { - cell._instance.selected = selected; - } - }); + this._toggleRowSelected(row, this._isSelected(row._item)); }); } } diff --git a/vaadin-grid-sort-mixin.html b/vaadin-grid-sort-mixin.html index bac90547a..fdc440a36 100644 --- a/vaadin-grid-sort-mixin.html +++ b/vaadin-grid-sort-mixin.html @@ -90,6 +90,8 @@ this.clearCache(); } + this._a11yUpdateSorters(); + this._previousSorters = this._mapSorters(); } diff --git a/vaadin-grid-sorter.html b/vaadin-grid-sorter.html index 686efd43c..fb55a359e 100644 --- a/vaadin-grid-sorter.html +++ b/vaadin-grid-sorter.html @@ -81,22 +81,12 @@ :host([direction=desc]) [part="indicators"]::before { content: "\e902"; } - - #announcer { - position: absolute; - z-index: -1; - clip: rect(0, 0, 0, 0); - text-transform: none; - }
- -