diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java | 21 |
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"); + } + }); } } |