]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6788,#6197 : stabilize dom structure of helper class to aid testing
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 14 Apr 2011 14:08:10 +0000 (14:08 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 14 Apr 2011 14:08:10 +0000 (14:08 +0000)
svn changeset:18299/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java

index 7bf00eb00c7f71878029de4bae161eb5bfceb002..24a98ee3efc55b8382c13c943e2abdfe1c442e4b 100644 (file)
@@ -74,10 +74,19 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements
                 // revert to original, not focusable
                 getElement().setPropertyObject("tabIndex", null);
 
+            } else {
+                moveFocusElementAfterWidget();
             }
         }
     }
 
+    /**
+     * Helper to keep focus element always in domChild[1]. Aids testing.
+     */
+    private void moveFocusElementAfterWidget() {
+        getElement().insertAfter(focusElement, getWidget().getElement());
+    }
+
     @Override
     public void setFocus(boolean focus) {
         if (useFakeFocusElement()) {