Merge pull request #120503 from conwnet/main

fix: only add readonly attribute to textarea dom when editor is readonly
This commit is contained in:
Alexandru Dima 2021-04-12 17:28:09 +02:00 committed by GitHub
commit d837f9a26c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,7 +132,7 @@ export class TextAreaHandler extends ViewPart {
this.textArea.setAttribute('aria-haspopup', 'false');
this.textArea.setAttribute('aria-autocomplete', 'both');
if (options.get(EditorOption.domReadOnly)) {
if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {
this.textArea.setAttribute('readonly', 'true');
}
@ -440,8 +440,8 @@ export class TextAreaHandler extends ViewPart {
this.textArea.setAttribute('aria-label', this._getAriaLabel(options));
this.textArea.setAttribute('tabindex', String(options.get(EditorOption.tabIndex)));
if (e.hasChanged(EditorOption.domReadOnly)) {
if (options.get(EditorOption.domReadOnly)) {
if (e.hasChanged(EditorOption.domReadOnly) || e.hasChanged(EditorOption.readOnly)) {
if (options.get(EditorOption.domReadOnly) && options.get(EditorOption.readOnly)) {
this.textArea.setAttribute('readonly', 'true');
} else {
this.textArea.removeAttribute('readonly');