Skip to content

Commit

Permalink
Accessibility: Accounts and Manage items role
Browse files Browse the repository at this point in the history
fixes #116473
  • Loading branch information
isidorn committed Feb 11, 2021
1 parent 5908eab commit 1887d9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class MenuActivityActionViewItem extends ActivityActionViewItem {
@IConfigurationService protected readonly configurationService: IConfigurationService,
@IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService
) {
super(action, { draggable: false, colors, icon: true }, themeService);
super(action, { draggable: false, colors, icon: true, hasPopup: true }, themeService);
}

render(container: HTMLElement): void {
Expand Down
10 changes: 8 additions & 2 deletions src/vs/workbench/browser/parts/compositeBarActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export interface ICompositeBarColors {
export interface IActivityActionViewItemOptions extends IBaseActionViewItemOptions {
icon?: boolean;
colors: (theme: IColorTheme) => ICompositeBarColors;
hasPopup?: boolean;
}

export class ActivityActionViewItem extends BaseActionViewItem {
Expand Down Expand Up @@ -199,7 +200,12 @@ export class ActivityActionViewItem extends BaseActionViewItem {

this.container = container;

this.container.setAttribute('role', 'tab');
if (this.options.hasPopup) {
this.container.setAttribute('role', 'button');
this.container.setAttribute('aria-haspopup', 'menu');

This comment has been minimized.

Copy link
@MarcoZehe

MarcoZehe Feb 11, 2021

Contributor

As discussed in the issue, let's stick with true here instead.

This comment has been minimized.

Copy link
@isidorn

isidorn Feb 11, 2021

Author Contributor

Yeah, I pushed an additional commit on top :)
a951596

} else {
this.container.setAttribute('role', 'tab');
}

// Try hard to prevent keyboard only focus feedback when using mouse
this._register(dom.addDisposableListener(this.container, dom.EventType.MOUSE_DOWN, () => {
Expand Down Expand Up @@ -386,7 +392,7 @@ export class CompositeOverflowActivityActionViewItem extends ActivityActionViewI
@IContextMenuService private readonly contextMenuService: IContextMenuService,
@IThemeService themeService: IThemeService
) {
super(action, { icon: true, colors }, themeService);
super(action, { icon: true, colors, hasPopup: true }, themeService);
}

showMenu(): void {
Expand Down

0 comments on commit 1887d9a

Please sign in to comment.