Skip to content

Commit 3d30e1a

Browse files
committed
accessibility: set aria-expanded and use role tab for activity bar items
fixes microsoft#97563
1 parent dd9685c commit 3d30e1a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/vs/workbench/browser/parts/compositeBarActions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
203203

204204
// Make the container tab-able for keyboard navigation
205205
this.container.tabIndex = 0;
206-
this.container.setAttribute('role', this.options.icon ? 'button' : 'tab');
206+
this.container.setAttribute('role', 'tab');
207207

208208
// Try hard to prevent keyboard only focus feedback when using mouse
209209
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_DOWN, () => {
@@ -649,9 +649,11 @@ export class CompositeActionViewItem extends ActivityActionViewItem {
649649
if (this.getAction().checked) {
650650
dom.addClass(this.container, 'checked');
651651
this.container.setAttribute('aria-label', nls.localize('compositeActive', "{0} active", this.container.title));
652+
this.container.setAttribute('aria-expanded', 'true');
652653
} else {
653654
dom.removeClass(this.container, 'checked');
654655
this.container.setAttribute('aria-label', this.container.title);
656+
this.container.setAttribute('aria-expanded', 'false');
655657
}
656658
this.updateStyles();
657659
}

0 commit comments

Comments
 (0)