Skip to content

Commit 3ee20fe

Browse files
authored
Merge pull request microsoft#157257 from microsoft/isidorn/single-donkey
actionViewItem - make sure to also set the aira-label on the label el…
2 parents 2062a59 + d4d52da commit 3ee20fe

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/vs/base/browser/ui/actionbar/actionViewItems.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class BaseActionViewItem extends Disposable implements IActionViewItem {
222222
return;
223223
}
224224
const title = this.getTooltip() ?? '';
225-
this.element.setAttribute('aria-label', title);
225+
this.updateAriaLabel();
226226
if (!this.options.hoverDelegate) {
227227
this.element.title = title;
228228
} else {
@@ -236,6 +236,13 @@ export class BaseActionViewItem extends Disposable implements IActionViewItem {
236236
}
237237
}
238238

239+
protected updateAriaLabel(): void {
240+
if (this.element) {
241+
const title = this.getTooltip() ?? '';
242+
this.element.setAttribute('aria-label', title);
243+
}
244+
}
245+
239246
protected updateClass(): void {
240247
// implement in subclass
241248
}
@@ -392,6 +399,13 @@ export class ActionViewItem extends BaseActionViewItem {
392399
}
393400
}
394401

402+
override updateAriaLabel(): void {
403+
if (this.label) {
404+
const title = this.getTooltip() ?? '';
405+
this.label.setAttribute('aria-label', title);
406+
}
407+
}
408+
395409
override updateChecked(): void {
396410
if (this.label) {
397411
if (this.getAction().checked) {

0 commit comments

Comments
 (0)