From 6e5f9725ebed511e1777a1bf66ae67e4863889e6 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 6 May 2020 10:44:31 +0200 Subject: [PATCH] Focus did not change with typing, re-announce element https://github.com/microsoft/vscode/issues/95961 --- src/vs/base/browser/ui/list/listWidget.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 8c9b875936e1f..3a855c310f226 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -26,6 +26,7 @@ import { CombinedSpliceable } from 'vs/base/browser/ui/list/splice'; import { clamp } from 'vs/base/common/numbers'; import { matchesPrefix } from 'vs/base/common/filters'; import { IDragAndDropData } from 'vs/base/browser/dnd'; +import { alert } from 'vs/base/browser/ui/aria/aria'; interface ITraitChangeEvent { indexes: number[]; @@ -428,6 +429,14 @@ class TypeLabelController implements IDisposable { if (typeof labelStr === 'undefined' || matchesPrefix(word, labelStr)) { this.list.setFocus([index]); this.list.reveal(index); + + if (index === start) { + // Focus did not change with typing, re-announce element https://github.com/microsoft/vscode/issues/95961 + const ariaLabel = this.list.options.accessibilityProvider ? this.list.options.accessibilityProvider.getAriaLabel(this.list.element(index)) : undefined; + if (ariaLabel) { + alert(ariaLabel); + } + } return; } }