]> source.dussan.org Git - vaadin-framework.git/commitdiff
Workaround for #6222 Vertical Table Scrolling Broken in Opera 11
authorArtur Signell <artur.signell@itmill.com>
Tue, 18 Jan 2011 16:55:48 +0000 (16:55 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 18 Jan 2011 16:55:48 +0000 (16:55 +0000)
svn changeset:16939/svn branch:6.5

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

index b59e1db50dcf57405ce5bc6d7e10d6befb80ae46..1cdd9c16e11f5c7fdf6eddff5cdfe1cf1fceca0e 100644 (file)
@@ -5593,11 +5593,26 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler,
      * 
      */
     private void setProperTabIndex() {
+        int storedScrollTop = 0;
+        int storedScrollLeft = 0;
+
+        if (BrowserInfo.get().getOperaVersion() >= 11) {
+            // Workaround for Opera scroll bug when changing tabIndex (#6222)
+            storedScrollTop = scrollBodyPanel.getScrollPosition();
+            storedScrollLeft = scrollBodyPanel.getHorizontalScrollPosition();
+        }
+
         if (tabIndex == 0 && !isFocusable()) {
             scrollBodyPanel.getElement().setTabIndex(-1);
         } else {
             scrollBodyPanel.getElement().setTabIndex(tabIndex);
         }
+
+        if (BrowserInfo.get().getOperaVersion() >= 11) {
+            // Workaround for Opera scroll bug when changing tabIndex (#6222)
+            scrollBodyPanel.setScrollPosition(storedScrollTop);
+            scrollBodyPanel.setHorizontalScrollPosition(storedScrollLeft);
+        }
     }
 
     public void onKeyUp(KeyUpEvent event) {