From 1c463a0229c408cb627da5dbee4660d4a5e50217 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Thu, 16 Jul 2015 17:31:54 +0300 Subject: [PATCH] Fix IE8 icons in tree expand regression (#18488) Change-Id: I6b7ee8776818e59a1607f55a93344209a2dfecc2 --- client/src/com/vaadin/client/ui/VTree.java | 15 +++++++++++++-- .../com/vaadin/client/ui/tree/TreeConnector.java | 6 +++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/client/src/com/vaadin/client/ui/VTree.java b/client/src/com/vaadin/client/ui/VTree.java index 8729de4a43..846b16d0cb 100644 --- a/client/src/com/vaadin/client/ui/VTree.java +++ b/client/src/com/vaadin/client/ui/VTree.java @@ -179,7 +179,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, @Override public void execute() { - Util.notifyParentOfSizeChange(VTree.this, true); + doLayout(); } }); @@ -969,7 +969,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, open = state; if (!rendering) { - Util.notifyParentOfSizeChange(VTree.this, false); + doLayout(); } } @@ -2239,4 +2239,15 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, com.google.gwt.user.client.Element captionElement) { AriaHelper.bindCaption(body, captionElement); } + + /** + * Tell LayoutManager that a layout is needed later for this VTree + */ + private void doLayout() { + // IE8 needs a hack to measure the tree again after update + WidgetUtil.forceIE8Redraw(getElement()); + + // This calls LayoutManager setNeedsMeasure and layoutNow + Util.notifyParentOfSizeChange(this, false); + } } diff --git a/client/src/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/com/vaadin/client/ui/tree/TreeConnector.java index fc3e6ca0fc..23091d0ad5 100644 --- a/client/src/com/vaadin/client/ui/tree/TreeConnector.java +++ b/client/src/com/vaadin/client/ui/tree/TreeConnector.java @@ -27,8 +27,8 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.Paintable; import com.vaadin.client.TooltipInfo; import com.vaadin.client.UIDL; -import com.vaadin.client.WidgetUtil; import com.vaadin.client.VConsole; +import com.vaadin.client.WidgetUtil; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.client.ui.VTree; @@ -62,6 +62,10 @@ public class TreeConnector extends AbstractComponentConnector implements if (uidl.hasAttribute("partialUpdate")) { handleUpdate(uidl); + + // IE8 needs a hack to measure the tree again after update + WidgetUtil.forceIE8Redraw(getWidget().getElement()); + getWidget().rendering = false; return; } -- 2.39.5