summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/Slot.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
index 00ff5bbc5a..49b3661431 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java
@@ -455,6 +455,7 @@ public final class Slot extends SimplePanel {
// since last time, and only run those changes
// Caption wrappers
+ Widget widget = getWidget();
if (captionText != null || iconUrl != null || error != null || required) {
if (caption == null) {
caption = DOM.createDiv();
@@ -462,10 +463,14 @@ public final class Slot extends SimplePanel {
captionWrap.addClassName(StyleConstants.UI_WIDGET);
captionWrap.addClassName("v-has-caption");
getElement().appendChild(captionWrap);
- captionWrap.appendChild(getWidget().getElement());
+ orphan(widget);
+ captionWrap.appendChild(widget.getElement());
+ adopt(widget);
}
} else if (caption != null) {
- getElement().appendChild(getWidget().getElement());
+ orphan(widget);
+ getElement().appendChild(widget.getElement());
+ adopt(widget);
captionWrap.removeFromParent();
caption = null;
captionWrap = null;