Skip to content

Commit ff859a5

Browse files
Update ARIA label on pfe-accordion (#628)
* issue-627/pfe-accordion-aria * modify aria role value * : Update tests and add changelog Co-authored-by: [ Cassondra ] <[email protected]>
1 parent 6a41811 commit ff859a5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG-prerelease.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Tag: [v1.0.0-prerelease.37](https://github.com/patternfly/patternfly-elements/releases/tag/v1.0.0-prerelease.37)
44

5-
- [27aa87d3](https://github.com/patternfly/patternfly-elements/commit/082467) fix: reference error when slot is missing in pfe-navigation
5+
- [6a41811](https://github.com/patternfly/patternfly-elements/commit/6a418112668ba580918ac4a8b4b54e8df05c1155) fix: reference error when slot is missing in pfe-navigation
6+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: accordion accessibility improvements; aria-roles corrected
67

78
## Prerelease 36 ( 2020-01-20 )
89

@@ -42,6 +43,7 @@ Tag: [v1.0.0-prerelease.32](https://github.com/patternfly/patternfly-elements/re
4243
- [ed919e](https://github.com/patternfly/patternfly-elements/commit/ed919ed15bffc03ee8de4539090c5de075f9ba7d) DE21128 Fix: Add support for theme hooks within surface colors mixin
4344
- [288322](https://github.com/patternfly/patternfly-elements/commit/2883224d927c26af3c7c9b92a9f8a3d2d852edaf) DE21423 Fix: z-index function now correctly prints variable names
4445
- [959281](https://github.com/patternfly/patternfly-elements/commit/95928118095d235695526d5dd5da9688ebc92fef) DE21491 Fix: Add default broadcast variables to pfe-base.css
46+
- [3ccec6](3ccec6c82efc52aae67b74072b6c0b8ff1b47f23) Update pfe-cta to include broadcast variables for all variants [#659](https://github.com/patternfly/patternfly-elements/issues/658)
4547

4648
## Prerelease 31 ( 2019-11-25 )
4749

elements/pfe-accordion/src/pfe-accordion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PfeAccordion extends PFElement {
5757
connectedCallback() {
5858
super.connectedCallback();
5959

60-
this.setAttribute("role", "presentation");
60+
this.setAttribute("role", "tablist");
6161
this.setAttribute("defined", "");
6262

6363
this.addEventListener(PfeAccordion.events.change, this._changeHandler);
@@ -443,7 +443,7 @@ class PfeAccordionHeader extends PFElement {
443443
}
444444

445445
if (!this.hasAttribute("role")) {
446-
this.setAttribute("role", "header");
446+
this.setAttribute("role", "heading");
447447
}
448448

449449
if (!this.pfeId) {

elements/pfe-accordion/test/pfe-accordion_test.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ <h2>Header</h2>
104104
const header = pfeAccordion.querySelector('pfe-accordion-header');
105105
const panel = pfeAccordion.querySelector('pfe-accordion-panel');
106106

107-
assert.equal(pfeAccordion.getAttribute('role'), 'presentation');
107+
assert.equal(pfeAccordion.getAttribute('role'), 'tablist');
108108
assert.isTrue(pfeAccordion.hasAttribute('defined'));
109109
assert.isTrue(header.hasAttribute('aria-controls'));
110-
assert.equal(header.getAttribute('role'), 'header');
110+
assert.equal(header.getAttribute('role'), 'heading');
111111
assert.isTrue(panel.hasAttribute('aria-labelledby'));
112112
assert.equal(panel.getAttribute('role'), 'region');
113113
assert.equal(header.pfeId, panel.getAttribute('aria-labelledby'));
@@ -380,7 +380,7 @@ <h2>Header</h2>
380380
const newHeaderElement = document.querySelector("#newHeader");
381381
const newPanelElement = document.querySelector("#newPanel");
382382

383-
assert.equal(newHeaderElement.getAttribute("role"), "header");
383+
assert.equal(newHeaderElement.getAttribute("role"), "heading");
384384
assert.isTrue(newHeaderElement.hasAttribute("pfe-id"));
385385
assert.isTrue(newHeaderElement.hasAttribute("aria-controls"));
386386
assert.equal(newHeaderElement.getAttribute("aria-controls"), newPanelElement.getAttribute("pfe-id"));

0 commit comments

Comments
 (0)