]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add comment explaining the dummy read in setStyleTemporarily
authorLeif Åstrand <leif@vaadin.com>
Tue, 24 Nov 2015 13:32:49 +0000 (15:32 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 24 Nov 2015 13:57:35 +0000 (13:57 +0000)
Change-Id: I763f3c68a3c9e471f9e5df21bbfbce41be17117c

client/src/com/vaadin/client/WidgetUtil.java

index b0e00307691fb928517176768384139fd23c1610..a861c6d8f62c06616e98abc09844bfad731b3837 100644 (file)
@@ -995,9 +995,12 @@ public class WidgetUtil {
         final String currentValue = style.getProperty(styleProperty);
 
         style.setProperty(styleProperty, tempValue);
+
+        // Read a style-based property to force the browser to recalculate the
+        // element's dimensions with the temporary style.
         element.getOffsetWidth();
-        style.setProperty(styleProperty, currentValue);
 
+        style.setProperty(styleProperty, currentValue);
     }
 
     /**