summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Koskinen <anna@vaadin.com>2013-01-29 10:46:32 +0200
committerAnna Koskinen <anna@vaadin.com>2013-02-01 14:29:18 +0200
commitf962b50de91c33e8f7b9d2f7ef467511af9647f2 (patch)
tree243110b0f00f2d8de46d3e4ea2517cc364bf8af1
parent9c6f83505896145c6d84534c610720ede83993e0 (diff)
downloadvaadin-framework-f962b50de91c33e8f7b9d2f7ef467511af9647f2.tar.gz
vaadin-framework-f962b50de91c33e8f7b9d2f7ef467511af9647f2.zip
Merge of (#10464) to Vaadin 7.
Don't steal focus back to Table from the address bar. Change-Id: I21c9da4a572e44c6ec4c33523acbfe717455f481
-rw-r--r--client/src/com/vaadin/client/ui/FocusableScrollPanel.java8
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java16
2 files changed, 20 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java
index a1d2ad6ccc..01d39392af 100644
--- a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java
+++ b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java
@@ -192,4 +192,12 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements
});
}
+ public Element getFocusElement() {
+ if (useFakeFocusElement()) {
+ return focusElement.cast();
+ } else {
+ return getElement();
+ }
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index 9ac9532ae4..b9244a1e91 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -6924,11 +6924,19 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
navKeyDown = false;
if (BrowserInfo.get().isIE()) {
- // IE sometimes moves focus to a clicked table cell...
+ /*
+ * IE sometimes moves focus to a clicked table cell... (#7965)
+ * ...and sometimes it sends blur events even though the focus
+ * handler is still active. (#10464)
+ */
Element focusedElement = Util.getIEFocusedElement();
- if (Util.getConnectorForElement(client, getParent(), focusedElement) == this) {
- // ..in that case, steal the focus back to the focus handler
- // but not if focus is in a child component instead (#7965)
+ if (Util.getConnectorForElement(client, getParent(), focusedElement) == this
+ && focusedElement != null
+ && focusedElement != scrollBodyPanel.getFocusElement()) {
+ /*
+ * Steal focus back to the focus handler if it was moved to some
+ * other part of the table. Avoid stealing focus in other cases.
+ */
focus();
return;
}