提交 ee4ccef5 编写于 作者: I isidor

do not announce if only one character typed to avoid duplicate announcment

上级 73bf9d35
......@@ -345,6 +345,7 @@ class TypeLabelController<T> implements IDisposable {
private automaticKeyboardNavigation = true;
private triggered = false;
private charactersTyped = 0;
private readonly enabledDisposables = new DisposableStore();
private readonly disposables = new DisposableStore();
......@@ -412,12 +413,15 @@ class TypeLabelController<T> implements IDisposable {
private onClear(): void {
const focus = this.list.getFocus();
if (focus.length > 0) {
if (focus.length > 0 && this.charactersTyped > 1) {
// List: re-anounce element on typing end since typed keys will interupt aria label of focused element
// Do not announce if only one character typed to avoid duplicate announcment https://github.com/microsoft/vscode/issues/95961
const ariaLabel = this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(focus[0]));
if (ariaLabel) {
alert(ariaLabel);
}
}
this.charactersTyped = 0;
}
private onInput(word: string | null): void {
......@@ -427,6 +431,7 @@ class TypeLabelController<T> implements IDisposable {
return;
}
this.charactersTyped++;
const focus = this.list.getFocus();
const start = focus.length > 0 ? focus[0] : 0;
const delta = this.state === TypeLabelControllerState.Idle ? 1 : 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册