@@ -52,6 +52,7 @@ import { assertType } from 'vs/base/common/types';
52
52
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels' ;
53
53
import { ExpansionState } from 'vs/workbench/contrib/interactiveEditor/browser/interactiveEditorSession' ;
54
54
import { IdleValue } from 'vs/base/common/async' ;
55
+ import * as aria from 'vs/base/browser/ui/aria/aria' ;
55
56
56
57
const defaultAriaLabel = localize ( 'aria-label' , "Interactive Editor Input" ) ;
57
58
@@ -246,6 +247,7 @@ export class InteractiveEditorWidget {
246
247
const hasFocus = this . _inputEditor . hasWidgetFocus ( ) ;
247
248
this . _ctxInputEditorFocused . set ( hasFocus ) ;
248
249
this . _elements . content . classList . toggle ( 'synthetic-focus' , hasFocus ) ;
250
+ this . readPlaceholder ( ) ;
249
251
} ;
250
252
this . _store . add ( this . _inputEditor . onDidFocusEditorWidget ( updateFocused ) ) ;
251
253
this . _store . add ( this . _inputEditor . onDidBlurEditorWidget ( updateFocused ) ) ;
@@ -271,6 +273,7 @@ export class InteractiveEditorWidget {
271
273
const hasText = this . _inputModel . getValueLength ( ) > 0 ;
272
274
this . _elements . placeholder . classList . toggle ( 'hidden' , hasText ) ;
273
275
this . _ctxInputEmpty . set ( ! hasText ) ;
276
+ this . readPlaceholder ( ) ;
274
277
275
278
const contentHeight = this . _inputEditor . getContentHeight ( ) ;
276
279
if ( contentHeight !== currentContentHeight && this . _lastDim ) {
@@ -435,6 +438,13 @@ export class InteractiveEditorWidget {
435
438
this . _elements . placeholder . innerText = value ;
436
439
}
437
440
441
+ readPlaceholder ( ) : void {
442
+ const hasText = this . _inputModel . getValueLength ( ) > 0 ;
443
+ if ( ! hasText ) {
444
+ aria . status ( this . _elements . placeholder . innerText ) ;
445
+ }
446
+ }
447
+
438
448
updateToolbar ( show : boolean ) {
439
449
this . _elements . statusToolbar . classList . toggle ( 'hidden' , ! show ) ;
440
450
this . _elements . feedbackToolbar . classList . toggle ( 'hidden' , ! show ) ;
0 commit comments