-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ASSETS-17274): Visual list is not marked up as list. #275
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,7 +221,7 @@ const SelectListItem = Decorator(class extends BaseComponent(HTMLElement) { | |
this.classList.add(CLASSNAME); | ||
|
||
if (!this.hasAttribute('role')) { | ||
this.setAttribute('role', 'option'); | ||
this.setAttribute('role', 'listitem'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change should not be made to the SelectListItem control. The WAI-ARIA |
||
} | ||
|
||
// Support cloneNode | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ describe('SelectList.Item', function () { | |
describe('Instantiation', function () { | ||
function testDefaultInstance(el) { | ||
expect(el.classList.contains('_coral-Menu-item')).to.be.true; | ||
expect(el.getAttribute('role')).to.equal('option'); | ||
expect(el.getAttribute('role')).to.equal('listitem'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test for |
||
} | ||
|
||
it('should be possible using new', function () { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ describe('SelectList', function () { | |
describe('Instantiation', function () { | ||
function testDefaultInstance(el) { | ||
expect(el.classList.contains('_coral-Menu')).to.be.true; | ||
expect(el.getAttribute('role')).equal('listbox'); | ||
expect(el.getAttribute('role')).equal('list'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test for |
||
} | ||
|
||
it('should be possible using new', function () { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be made to the SelectList control. The WAI-ARIA
listbox
role is a widget role, that will force a screen reader into forms mode, allowing the user to navigate using the arrow keys. Alist
is a static role defining content structure. Think about this as the difference between a<select>
element and aul
orol
in HTML.