]> source.dussan.org Git - vaadin-framework.git/commitdiff
Force reflow in IE8 to detect icon style (#8313)
authorLeif Åstrand <leif@vaadin.com>
Wed, 21 Mar 2012 13:32:16 +0000 (15:32 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 21 Mar 2012 13:32:32 +0000 (15:32 +0200)
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java

index 7fdcaff47ced67bed8745d953ac154d89210a78a..a3c273260efeb1c026cbc84c28a1f4c1b03fa01d 100644 (file)
@@ -1605,9 +1605,20 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
              * Lock the textbox width to its current value if it's not already
              * locked
              */
-            if (!tb.getElement().getStyle().getWidth().endsWith("px")) {
+            Style style = tb.getElement().getStyle();
+            if (!style.getWidth().endsWith("px")) {
+                boolean isIE8 = BrowserInfo.get().isIE8();
+                if (isIE8) {
+                    // Must do something to make IE8 realize that it should
+                    // reflow the component when the offset width is read
+                    style.setProperty("zoom", "1");
+                }
                 tb.setWidth((tb.getOffsetWidth() - selectedItemIcon
                         .getOffsetWidth()) + "px");
+                if (isIE8) {
+                    // Restore old style property value
+                    style.clearProperty("zoom");
+                }
             }
         }
     }