Skip to content

Commit 8a9c6c0

Browse files
committed
reading out the placeholder, when updating the placecholder and on interactive editor input focused, when no text written
1 parent edcad3a commit 8a9c6c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorWidget.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { SubmenuItemAction } from 'vs/platform/actions/common/actions';
4848
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
4949
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
5050
import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityContribution';
51+
import * as aria from 'vs/base/browser/ui/aria/aria';
5152

5253
const defaultAriaLabel = localize('aria-label', "Interactive Editor Input");
5354

@@ -232,6 +233,7 @@ export class InteractiveEditorWidget {
232233
const hasFocus = this._inputEditor.hasWidgetFocus();
233234
ctxInputEditorFocused.set(hasFocus);
234235
this._elements.content.classList.toggle('synthetic-focus', hasFocus);
236+
this.readPlaceholder();
235237
};
236238
this._store.add(this._inputEditor.onDidFocusEditorWidget(updateFocused));
237239
this._store.add(this._inputEditor.onDidBlurEditorWidget(updateFocused));
@@ -252,6 +254,7 @@ export class InteractiveEditorWidget {
252254
const hasText = this._inputModel.getValueLength() > 0;
253255
this._elements.placeholder.classList.toggle('hidden', hasText);
254256
this._ctxInputEmpty.set(!hasText);
257+
this.readPlaceholder();
255258

256259
const contentHeight = this._inputEditor.getContentHeight();
257260
if (contentHeight !== currentContentHeight && this._lastDim) {
@@ -387,6 +390,13 @@ export class InteractiveEditorWidget {
387390
this._elements.placeholder.innerText = value;
388391
}
389392

393+
readPlaceholder(): void {
394+
const hasText = this._inputModel.getValueLength() > 0;
395+
if (!hasText) {
396+
aria.status(this._elements.placeholder.innerText);
397+
}
398+
}
399+
390400
updateToolbar(show: boolean) {
391401
this._elements.statusToolbar.classList.toggle('hidden', !show);
392402
this._onDidChangeHeight.fire();

0 commit comments

Comments
 (0)