]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #2573 - Added fixed default width for RichTextArea
authorArtur Signell <artur.signell@itmill.com>
Thu, 12 Feb 2009 10:54:38 +0000 (10:54 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 12 Feb 2009 10:54:38 +0000 (10:54 +0000)
svn changeset:6816/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/richtextarea/IRichTextArea.java

index dab5fd9dd54ed032e23bc269e07b99e35678113e..09142b40826d49ea8d514cf1e0ecea04ff893280 100644 (file)
@@ -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);
         }