summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAutomerge <automerge@vaadin.com>2012-05-08 09:06:50 +0000
committerAutomerge <automerge@vaadin.com>2012-05-08 09:06:50 +0000
commit8cfb84d9ec1570f7b14890edadebdf43a474be8c (patch)
tree09d3680d352d54d86bbefd09bb3a836fd21bf5ec /src/com
parentff05bab8e8d21a9fa13295f05e5cd1f9fbe60bda (diff)
downloadvaadin-framework-8cfb84d9ec1570f7b14890edadebdf43a474be8c.tar.gz
vaadin-framework-8cfb84d9ec1570f7b14890edadebdf43a474be8c.zip
[merge from 6.7] Don't activate tab when clicking close element (#7686)
svn changeset:23690/svn branch:6.8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
index f1a5b31379..d3836bb177 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java
@@ -350,6 +350,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
}
return width;
}
+ public Element getCloseButton() {
+ return closeButton;
+ }
+
}
static class TabBar extends ComplexPanel implements ClickHandler,
@@ -412,7 +416,14 @@ public class VTabsheet extends VTabsheetBase implements Focusable,
}
public void onClick(ClickEvent event) {
- Widget caption = (Widget) event.getSource();
+ TabCaption caption = (TabCaption) event.getSource();
+ Element targetElement = event.getNativeEvent().getEventTarget()
+ .cast();
+ // the tab should not be focused if the close button was clicked
+ if (targetElement == caption.getCloseButton()) {
+ return;
+ }
+
int index = getWidgetIndex(caption.getParent());
// IE needs explicit focus()
if (BrowserInfo.get().isIE()) {