@@ -44,6 +44,7 @@ const ConsoleDataLoader: React.FC<ConsoleDataLoaderProps> = props => {
44
44
...( terminalRef . current . terminal . options || { } ) ,
45
45
cursorStyle : 'underline' ,
46
46
cursorBlink : true ,
47
+ screenReaderMode : true ,
47
48
} ;
48
49
49
50
resizeHandler ( width , height ) ;
@@ -67,6 +68,7 @@ const ConsoleDataLoader: React.FC<ConsoleDataLoaderProps> = props => {
67
68
terminalRef . current . terminal . options = {
68
69
...( terminalRef . current . terminal . options || { } ) ,
69
70
disableStdin : true ,
71
+ screenReaderMode : true ,
70
72
} ;
71
73
72
74
resizeHandler ( width , height ) ;
@@ -126,6 +128,13 @@ const ConsoleDataLoader: React.FC<ConsoleDataLoaderProps> = props => {
126
128
127
129
const updateConsoleText = ( text : string ) => {
128
130
terminalRef . current ?. terminal . write ( text ) ;
131
+ const liveRegion = document . getElementById ( 'live-region' ) ;
132
+ if ( liveRegion ) {
133
+ liveRegion . textContent = `${ liveRegion . textContent || '' } ${ text } ` ;
134
+ setTimeout ( ( ) => {
135
+ liveRegion . textContent = '' ;
136
+ } , 1000 ) ; // Clear after 1 second
137
+ }
129
138
} ;
130
139
131
140
const onData = ( data : string ) => {
@@ -215,6 +224,7 @@ const ConsoleDataLoader: React.FC<ConsoleDataLoaderProps> = props => {
215
224
terminalRef . current . terminal . options = {
216
225
...( terminalRef . current . terminal . options || { } ) ,
217
226
disableStdin : false ,
227
+ screenReaderMode : true ,
218
228
} ;
219
229
}
220
230
}
@@ -268,6 +278,17 @@ const ConsoleDataLoader: React.FC<ConsoleDataLoaderProps> = props => {
268
278
return (
269
279
< div className = { containerAppStyles . divContainer } >
270
280
< XTerm ref = { terminalRef } onData = { onData } onKey = { onKey } />
281
+ < div
282
+ id = "live-region"
283
+ aria-live = "polite"
284
+ style = { {
285
+ position : 'absolute' ,
286
+ left : '-9999px' ,
287
+ width : '1px' ,
288
+ height : '1px' ,
289
+ overflow : 'hidden' ,
290
+ } }
291
+ />
271
292
< Dialog hidden = { hideDialog } dialogContentProps = { dialogContentProps } modalProps = { modalProps } forceFocusInsideTrap = { false } >
272
293
{ isDebug ? (
273
294
< Text > { t ( 'containerApp_console_debugConsoleDescription' ) } </ Text >
0 commit comments