Skip to content

Commit

Permalink
Add aria-label and aria-selected to tab bars.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout authored and telamonian committed Nov 17, 2020
1 parent 6ffad17 commit 943e83e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/widgets/src/tabbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class TabBar<T extends Widget> extends Widget {
let contentNode = this.contentNode;
contentNode.setAttribute('role', 'tablist');
contentNode.setAttribute('aria-orientation', this.orientation);

// TODO: what should this be?
contentNode.setAttribute('aria-label', 'Tabs');
}

/**
Expand Down Expand Up @@ -1587,7 +1590,7 @@ namespace TabBar {
* @returns The ARIA attributes for the tab.
*/
createTabARIA(data: IRenderData<T>): ElementARIAAttrs {
return {role: 'tab', 'aria-controls': data.title.owner.id};
return {role: 'tab', 'aria-controls': data.title.owner.id, 'aria-selected': data.current.toString()};
}

/**
Expand Down

0 comments on commit 943e83e

Please sign in to comment.