summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@itmill.com>2011-05-18 09:56:28 +0000
committerHenri Sara <henri.sara@itmill.com>2011-05-18 09:56:28 +0000
commitede7ae44d8573a4fa1052204940245fcb2c402ac (patch)
tree8184d31623f9a7960d7402c33cbd15de51f3a24f /src
parenta87072367ade16fc480177aee36ca31743f18fb9 (diff)
downloadvaadin-framework-ede7ae44d8573a4fa1052204940245fcb2c402ac.tar.gz
vaadin-framework-ede7ae44d8573a4fa1052204940245fcb2c402ac.zip
#5547 Table horizontal scroller goes out of sync in Chrome when changing visible columns
svn changeset:18881/svn branch:6.6
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index 70af13bd4b..7edad795fe 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -589,6 +589,7 @@ public class Util {
// check the scrolltop value before hiding the element
final int scrolltop = elem.getScrollTop();
+ final int scrollleft = elem.getScrollLeft();
elem.getStyle().setProperty("overflow", "hidden");
Scheduler.get().scheduleDeferred(new Command() {
@@ -598,7 +599,7 @@ public class Util {
if (scrolltop > 0 || elem.getScrollTop() > 0) {
int scrollvalue = scrolltop;
- if (scrolltop == 0) {
+ if (scrollvalue == 0) {
// mysterious are the ways of webkits scrollbar
// handling. In some cases webkit reports bad (0)
// scrolltop before hiding the element temporary,
@@ -610,6 +611,25 @@ public class Util {
elem.setScrollTop(scrollvalue - 1);
elem.setScrollTop(scrollvalue);
}
+
+ // fix for #5547: Table horizontal scroll sometimes not
+ // updated when collapsing/expanding columns
+ if (BrowserInfo.get().isChrome()
+ && (scrollleft > 0 || elem.getScrollLeft() > 0)) {
+ int scrollvalue = scrollleft;
+
+ if (scrollvalue == 0) {
+ // mysterious are the ways of webkits scrollbar
+ // handling. In some cases webkit may report a bad
+ // (0) scrollleft before hiding the element
+ // temporary, sometimes after.
+ scrollvalue = elem.getScrollLeft();
+ }
+ // fix another bug where scrollbar remains in wrong
+ // position
+ elem.setScrollLeft(scrollvalue - 1);
+ elem.setScrollLeft(scrollvalue);
+ }
}
});
}