aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Alhroos <john.ahlroos@itmill.com>2010-06-29 14:08:28 +0000
committerJohn Alhroos <john.ahlroos@itmill.com>2010-06-29 14:08:28 +0000
commit8dfc1400437ea34f67cd5995b27356d74960640f (patch)
tree8446e3ac806c0aa024e03801b09897a809cdd696
parent85c16f072b43e1b4c38817fa7bf0ff2fb0f2ecde (diff)
downloadvaadin-framework-8dfc1400437ea34f67cd5995b27356d74960640f.tar.gz
vaadin-framework-8dfc1400437ea34f67cd5995b27356d74960640f.zip
Fix for #5091
svn changeset:13966/svn branch:6.4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
index e7ea12a1ed..1e31dffb6e 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java
@@ -195,12 +195,21 @@ public class VRichTextArea extends Composite implements Paintable, Field,
if (height == null || height.equals("")) {
rta.setHeight("");
} else {
- int editorHeight = getOffsetHeight() - getExtraVerticalPixels()
- - formatter.getOffsetHeight();
- if (editorHeight < 0) {
- editorHeight = 0;
- }
- rta.setHeight(editorHeight + "px");
+ /*
+ * The formatter height will be initially calculated wrong so we
+ * delay the height setting so the DOM has had time to stabilize.
+ */
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ int editorHeight = getOffsetHeight()
+ - getExtraVerticalPixels()
+ - formatter.getOffsetHeight();
+ if (editorHeight < 0) {
+ editorHeight = 0;
+ }
+ rta.setHeight(editorHeight + "px");
+ }
+ });
}
}