From 1902b4a17762a29337805ad399e0f654a81dc224 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 12 Feb 2009 10:54:38 +0000 Subject: [PATCH] Fix for #2573 - Added fixed default width for RichTextArea svn changeset:6816/svn branch:trunk --- .../gwt/client/ui/richtextarea/IRichTextArea.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/richtextarea/IRichTextArea.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/richtextarea/IRichTextArea.java index dab5fd9dd5..09142b4082 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/richtextarea/IRichTextArea.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/richtextarea/IRichTextArea.java @@ -58,6 +58,8 @@ public class IRichTextArea extends Composite implements Paintable, Field, private int maxLength = -1; + private int toolbarNaturalWidth = 500; + public IRichTextArea() { fp.add(formatter); @@ -210,13 +212,17 @@ public class IRichTextArea extends Composite implements Paintable, Field, } super.setWidth(w + "px"); - } else if (width.equals("") && BrowserInfo.get().isIE()) { + } else if (width.equals("")) { /* * IE cannot calculate the width of the 100% iframe correctly if - * there is no width specified for the parent so we use the width of - * the toolbar. + * there is no width specified for the parent. In this case we would + * use the toolbar but IE cannot calculate the width of that one + * correctly either in all cases. So we end up using a default width + * for a RichTextArea with no width definition in all browsers (for + * compatibility). */ - super.setWidth(formatter.getOffsetWidth() + "px"); + + super.setWidth(toolbarNaturalWidth + "px"); } else { super.setWidth(width); } -- 2.39.5