File tree Expand file tree Collapse file tree
src/vs/base/browser/ui/aria Expand file tree Collapse file tree Original file line number Diff line number Diff 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 */
4949export 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 */
6367export 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
7785function 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 ) ;
You can’t perform that action at this time.
0 commit comments