]> source.dussan.org Git - vaadin-framework.git/commitdiff
Merge of (#10464) to Vaadin 7.
authorAnna Koskinen <anna@vaadin.com>
Tue, 29 Jan 2013 08:46:32 +0000 (10:46 +0200)
committerAnna Koskinen <anna@vaadin.com>
Fri, 1 Feb 2013 12:29:18 +0000 (14:29 +0200)
Don't steal focus back to Table from the address bar.

Change-Id: I21c9da4a572e44c6ec4c33523acbfe717455f481

client/src/com/vaadin/client/ui/FocusableScrollPanel.java
client/src/com/vaadin/client/ui/VScrollTable.java

index a1d2ad6ccca56fb17c82d8df6c98a44bf62c1984..01d39392af0892feed72c2924710f9c14e1f950e 100644 (file)
@@ -192,4 +192,12 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements
         });
     }
 
+    public Element getFocusElement() {
+        if (useFakeFocusElement()) {
+            return focusElement.cast();
+        } else {
+            return getElement();
+        }
+    }
+
 }
index 9ac9532ae4531dce15d1574e61dd56f1533e9a40..b9244a1e9190a6ebcf79d7acfcec2674bbe5ae0b 100644 (file)
@@ -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;
             }