diff options
author | John Ahlroos <john@vaadin.com> | 2013-04-24 10:52:53 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2013-04-24 10:52:53 +0300 |
commit | c1cf0cb575703307efb88c90f35d6e3c80e44423 (patch) | |
tree | a926cdf1672f84a0c1f87ce566c680a0896172c3 /client | |
parent | 9c6d4b4add253b96feb2d8bc41354c44bb8834d6 (diff) | |
download | vaadin-framework-c1cf0cb575703307efb88c90f35d6e3c80e44423.tar.gz vaadin-framework-c1cf0cb575703307efb88c90f35d6e3c80e44423.zip |
Fix for IE8 forgetting to move error indicator when component is resized #11693"
Change-Id: I09d4e77f5f8f5b8846e8083b3bfbf3155281038d
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/orderedlayout/Slot.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java index 795b724292..4fb5acf287 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java @@ -24,8 +24,11 @@ import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.UIObject; import com.google.gwt.user.client.ui.Widget; +import com.vaadin.client.BrowserInfo; import com.vaadin.client.LayoutManager; import com.vaadin.client.StyleConstants; +import com.vaadin.client.Util; +import com.vaadin.client.ui.layout.ElementResizeEvent; import com.vaadin.client.ui.layout.ElementResizeListener; import com.vaadin.shared.ui.AlignmentInfo; @@ -92,6 +95,18 @@ public final class Slot extends SimplePanel { private ElementResizeListener spacingResizeListener; + /* + * This listener is applied only in IE8 to workaround browser issue where + * IE8 forgets to update the error indicator position when the slot gets + * resized by widget resizing itself. #11693 + */ + private ElementResizeListener ie8CaptionElementResizeUpdateListener = new ElementResizeListener() { + + @Override + public void onElementResize(ElementResizeEvent e) { + Util.forceIE8Redraw(getCaptionElement()); + } + }; // Caption is placed after component unless there is some part which // moves it above. @@ -161,6 +176,11 @@ public final class Slot extends SimplePanel { lm.addElementResizeListener(getSpacingElement(), spacingResizeListener); } + + if (BrowserInfo.get().isIE8()) { + lm.addElementResizeListener(getWidget().getElement(), + ie8CaptionElementResizeUpdateListener); + } } } @@ -182,6 +202,11 @@ public final class Slot extends SimplePanel { lm.removeElementResizeListener(getSpacingElement(), spacingResizeListener); } + + if (BrowserInfo.get().isIE8()) { + lm.removeElementResizeListener(getWidget().getElement(), + ie8CaptionElementResizeUpdateListener); + } } } |