Skip to content

Commit

Permalink
Merge pull request #507 from brichet/accessibility
Browse files Browse the repository at this point in the history
Accessibility: role attributes
  • Loading branch information
krassowski authored Dec 30, 2022
2 parents fa048e1 + ca46a03 commit 16a9f4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/widgets/src/accordionpanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export namespace AccordionPanel {
*/
createSectionTitle(data: Title<Widget>): HTMLElement {
const handle = document.createElement('h3');
handle.setAttribute('role', 'button');
handle.setAttribute('role', 'tab');
handle.setAttribute('tabindex', '0');
handle.id = this.createTitleKey(data);
handle.className = this.titleClassName;
Expand Down
6 changes: 4 additions & 2 deletions packages/widgets/src/commandpalette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ export namespace CommandPalette {
{
className,
dataset,
role: 'checkbox',
role: 'menuitemcheckbox',
'aria-checked': `${data.item.isToggled}`
},
this.renderItemIcon(data),
Expand All @@ -782,7 +782,8 @@ export namespace CommandPalette {
return h.li(
{
className,
dataset
dataset,
role: 'menuitem'
},
this.renderItemIcon(data),
this.renderItemContent(data),
Expand Down Expand Up @@ -1012,6 +1013,7 @@ namespace Private {
clear.className = 'lm-close-icon';

content.className = 'lm-CommandPalette-content';
content.setAttribute('role', 'menu');
input.spellcheck = false;
wrapper.appendChild(input);
wrapper.appendChild(clear);
Expand Down

0 comments on commit 16a9f4a

Please sign in to comment.