From 69ae6cdf2183dd8c7a7e845dec7f032ce9ff2af9 Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Mon, 30 Sep 2019 16:59:08 +0200 Subject: [PATCH] Only use the readonly attribute on the web --- src/vs/editor/browser/controller/textAreaHandler.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts index 7ccc7ed413f..7d5cab28c98 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -152,7 +152,7 @@ export class TextAreaHandler extends ViewPart { this.textArea.setAttribute('aria-haspopup', 'false'); this.textArea.setAttribute('aria-autocomplete', 'both'); - if (options.get(EditorOption.readOnly)) { + if (platform.isWeb && options.get(EditorOption.readOnly)) { this.textArea.setAttribute('readonly', 'true'); } @@ -399,10 +399,12 @@ export class TextAreaHandler extends ViewPart { this._copyWithSyntaxHighlighting = options.get(EditorOption.copyWithSyntaxHighlighting); this.textArea.setAttribute('aria-label', this._getAriaLabel(options)); - if (options.get(EditorOption.readOnly)) { - this.textArea.setAttribute('readonly', 'true'); - } else { - this.textArea.removeAttribute('readonly'); + 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)) {