summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnastasia Smirnova <anasmi@utu.fi>2018-04-20 09:59:44 +0300
committerIlia Motornyi <elmot@vaadin.com>2018-04-20 09:59:44 +0300
commit3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7 (patch)
tree18290c97503062b18defdbe5de29668c093c26f2 /client
parentd543e47becc77e5b18c69a416e6e84122ac10fe1 (diff)
downloadvaadin-framework-3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7.tar.gz
vaadin-framework-3ffb27fa734195f103fdbfb5ad6c81d7a8b006f7.zip
Fix RichTextArea read-only+disabled
Resolves #10541
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VRichTextArea.java7
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