From 8dfc1400437ea34f67cd5995b27356d74960640f Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Tue, 29 Jun 2010 14:08:28 +0000 Subject: [PATCH] Fix for #5091 svn changeset:13966/svn branch:6.4 --- .../client/ui/richtextarea/VRichTextArea.java | 21 +++++++++++++------ 1 file 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"); + } + }); } } -- 2.39.5