Skip to content

Commit 79e075e

Browse files
committed
fix tests
1 parent 1720275 commit 79e075e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/vs/base/browser/ui/aria/aria.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export function setARIAContainer(parent: HTMLElement) {
4747
* Given the provided message, will make sure that it is read as alert to screen readers.
4848
*/
4949
export function alert(msg: string): void {
50+
if (!ariaContainer) {
51+
return;
52+
}
53+
5054
// Use alternate containers such that duplicated messages get read out by screen readers #99466
5155
if (alertContainer.textContent !== msg) {
5256
dom.clearNode(alertContainer2);
@@ -61,6 +65,10 @@ export function alert(msg: string): void {
6165
* Given the provided message, will make sure that it is read as status to screen readers.
6266
*/
6367
export function status(msg: string): void {
68+
if (!ariaContainer) {
69+
return;
70+
}
71+
6472
if (isMacintosh) {
6573
alert(msg); // VoiceOver does not seem to support status role
6674
} else {
@@ -75,10 +83,6 @@ export function status(msg: string): void {
7583
}
7684

7785
function insertMessage(target: HTMLElement, msg: string): void {
78-
if (!ariaContainer) {
79-
return;
80-
}
81-
8286
dom.clearNode(target);
8387
if (msg.length > MAX_MESSAGE_LENGTH) {
8488
msg = msg.substr(0, MAX_MESSAGE_LENGTH);

0 commit comments

Comments
 (0)