diff options
author | Anastasia Smirnova <anasmi@utu.fi> | 2018-04-20 09:59:44 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-04-20 15:19:23 +0300 |
commit | c1557438328771d6ccec25acc515f7d0035482c4 (patch) | |
tree | b0f3e0a3f2fca2b02245920a0f039e928fa44a54 /client | |
parent | a10e72c67aef3ff6cc6760b68ede57b2606b7a37 (diff) | |
download | vaadin-framework-c1557438328771d6ccec25acc515f7d0035482c4.tar.gz vaadin-framework-c1557438328771d6ccec25acc515f7d0035482c4.zip |
Fix RichTextArea read-only+disabled
Resolves #10541
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VRichTextArea.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java index 4f436bf51d..1ed07c4cec 100644 --- a/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java +++ b/client/src/main/java/com/vaadin/client/ui/VRichTextArea.java @@ -163,8 +163,8 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, public void setEnabled(boolean enabled) { if (this.enabled != enabled) { // rta.setEnabled(enabled); - swapEditableArea(); this.enabled = enabled; + swapEditableArea(); } } @@ -179,6 +179,9 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, private void swapEditableArea() { String value = getValue(); if (html.isAttached()) { + if (isReadOnly() || !isEnabled()) { + return; + } fp.remove(html); if (BrowserInfo.get().isWebkit()) { fp.remove(formatter); @@ -218,8 +221,8 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, public void setReadOnly(boolean b) { if (isReadOnly() != b) { - swapEditableArea(); readOnly = b; + swapEditableArea(); } // reset visibility in case enabled state changed and the formatter was // recreated |