mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 02:26:04 +00:00
A readOnly editor doesn't honor readonly in the textArea (#81394)
A readOnly editor doesn't honor readonly in the textArea
This commit is contained in:
commit
531522b76e
|
@ -152,6 +152,10 @@ export class TextAreaHandler extends ViewPart {
|
|||
this.textArea.setAttribute('aria-haspopup', 'false');
|
||||
this.textArea.setAttribute('aria-autocomplete', 'both');
|
||||
|
||||
if (platform.isWeb && options.get(EditorOption.readOnly)) {
|
||||
this.textArea.setAttribute('readonly', 'true');
|
||||
}
|
||||
|
||||
this.textAreaCover = createFastDomNode(document.createElement('div'));
|
||||
this.textAreaCover.setPosition('absolute');
|
||||
|
||||
|
@ -395,6 +399,14 @@ export class TextAreaHandler extends ViewPart {
|
|||
this._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting);
|
||||
this.textArea.setAttribute('aria-label', this._getAriaLabel(options));
|
||||
|
||||
if (platform.isWeb && e.hasChanged(EditorOption.readOnly)) {
|
||||
if (options.get(EditorOption.readOnly)) {
|
||||
this.textArea.setAttribute('readonly', 'true');
|
||||
} else {
|
||||
this.textArea.removeAttribute('readonly');
|
||||
}
|
||||
}
|
||||
|
||||
if (e.hasChanged(EditorOption.accessibilitySupport)) {
|
||||
this._textAreaInput.writeScreenReaderContent('strategy changed');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue