From c1cf0cb575703307efb88c90f35d6e3c80e44423 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Wed, 24 Apr 2013 10:52:53 +0300 Subject: [PATCH] Fix for IE8 forgetting to move error indicator when component is resized #11693" Change-Id: I09d4e77f5f8f5b8846e8083b3bfbf3155281038d --- .../vaadin/client/ui/orderedlayout/Slot.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) 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); + } } } -- 2.39.5