From: Anna Koskinen Date: Tue, 29 Jan 2013 08:46:32 +0000 (+0200) Subject: Merge of (#10464) to Vaadin 7. X-Git-Tag: 7.0.1~72^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f962b50de91c33e8f7b9d2f7ef467511af9647f2;p=vaadin-framework.git Merge of (#10464) to Vaadin 7. Don't steal focus back to Table from the address bar. Change-Id: I21c9da4a572e44c6ec4c33523acbfe717455f481 --- 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; }