aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com')
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java15
-rw-r--r--server/src/main/java/com/vaadin/ui/TabSheet.java5
2 files changed, 20 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index d289ee4897..b42cff2cab 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -4753,4 +4753,19 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
}
}
+ @Override
+ public void setVisible(boolean visible) {
+ if (getEditor().isOpen() && !visible) {
+ getEditor().cancel();
+ }
+ super.setVisible(visible);
+ }
+
+ @Override
+ public void detach() {
+ if (getEditor().isOpen()) {
+ getEditor().cancel();
+ }
+ super.detach();
+ }
}
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