aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/TabSheet.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/TabSheet.java')
-rw-r--r--server/src/main/java/com/vaadin/ui/TabSheet.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java
index a9ed1e9e02..5600745334 100644
--- a/server/src/main/java/com/vaadin/ui/TabSheet.java
+++ b/server/src/main/java/com/vaadin/ui/TabSheet.java
@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Objects;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Element;
@@ -584,6 +585,10 @@ public class TabSheet extends AbstractComponentContainer
*/
private void setSelected(Component component) {
Tab tab = tabs.get(selected);
+ if (tab != null && !Objects.equals(tab.getComponent(), component) && tab.getComponent() != null && tab.getComponent().isAttached()) {
+ tab.getComponent().detach();
+ tab.getComponent().attach(); // ugly hack
+ }
selected = component;
// Repaint of the selected component is needed as only the selected