Skip to content

Commit 16a9f4a

Browse files
authored
Merge pull request #507 from brichet/accessibility
Accessibility: role attributes
2 parents fa048e1 + ca46a03 commit 16a9f4a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/widgets/src/accordionpanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export namespace AccordionPanel {
401401
*/
402402
createSectionTitle(data: Title<Widget>): HTMLElement {
403403
const handle = document.createElement('h3');
404-
handle.setAttribute('role', 'button');
404+
handle.setAttribute('role', 'tab');
405405
handle.setAttribute('tabindex', '0');
406406
handle.id = this.createTitleKey(data);
407407
handle.className = this.titleClassName;

packages/widgets/src/commandpalette.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ export namespace CommandPalette {
771771
{
772772
className,
773773
dataset,
774-
role: 'checkbox',
774+
role: 'menuitemcheckbox',
775775
'aria-checked': `${data.item.isToggled}`
776776
},
777777
this.renderItemIcon(data),
@@ -782,7 +782,8 @@ export namespace CommandPalette {
782782
return h.li(
783783
{
784784
className,
785-
dataset
785+
dataset,
786+
role: 'menuitem'
786787
},
787788
this.renderItemIcon(data),
788789
this.renderItemContent(data),
@@ -1012,6 +1013,7 @@ namespace Private {
10121013
clear.className = 'lm-close-icon';
10131014

10141015
content.className = 'lm-CommandPalette-content';
1016+
content.setAttribute('role', 'menu');
10151017
input.spellcheck = false;
10161018
wrapper.appendChild(input);
10171019
wrapper.appendChild(clear);

0 commit comments

Comments
 (0)