]> source.dussan.org Git - vaadin-framework.git/commitdiff
Revised [21596] miscalculation fix to take possibly set CSS paddings into consideration.
authorJohn Alhroos <john.ahlroos@itmill.com>
Thu, 6 Oct 2011 10:22:49 +0000 (10:22 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Thu, 6 Oct 2011 10:22:49 +0000 (10:22 +0000)
svn changeset:21597/svn branch:6.7

src/com/vaadin/terminal/gwt/client/ui/VForm.java

index 18e0a3790d4f13a1d6eb0b1d9d040a9d8ef213c2..8b682d65d1a7c85734bdb53f2e4054bc3794e838 100644 (file)
@@ -74,6 +74,9 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler {
         errorIndicatorElement.getStyle().setDisplay(Display.NONE);\r
         errorIndicatorElement.setInnerText(" "); // needed for IE\r
         desc.setClassName("v-form-description");\r
+        fieldSet.appendChild(desc); // Adding description for initial padding\r
+                                    // measurements, removed later if no\r
+                                    // description is set\r
         fieldSet.appendChild(fieldContainer);\r
         errorMessage.setVisible(false);\r
         errorMessage.setStyleName(CLASSNAME + "-errormessage");\r
@@ -300,9 +303,9 @@ public class VForm extends ComplexPanel implements Container, KeyDownHandler {
 \r
     @Override\r
     public void setWidth(String width) {\r
-        if (borderPaddingHorizontal < 0 && desc.hasParentElement()) {\r
+        if (borderPaddingHorizontal < 0) {\r
             // measure excess size lazily after stylename setting, but before\r
-            // setting width if description is attached\r
+            // setting width\r
             int ow = getOffsetWidth();\r
             int dow = desc.getOffsetWidth();\r
             borderPaddingHorizontal = ow - dow;\r