summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorOlli Tietäväinen <ollit@vaadin.com>2017-03-09 12:49:07 +0200
committerHenri Sara <henri.sara@gmail.com>2017-03-09 12:49:07 +0200
commit520f2e9f21367799f000911159f2ea5d9bf9e0f2 (patch)
tree995f70207c6ed1907320915e0c21f8330c295205 /client
parent31bbf226160ca5e7007d714696a9209308bc7cf5 (diff)
downloadvaadin-framework-520f2e9f21367799f000911159f2ea5d9bf9e0f2.tar.gz
vaadin-framework-520f2e9f21367799f000911159f2ea5d9bf9e0f2.zip
Fix Panel.setScrollTop() for large values (#8563)
Fixes #1149
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
index 5766851bba..9cf90b6254 100644
--- a/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java
@@ -226,7 +226,14 @@ public class PanelConnector extends AbstractSingleComponentContainerConnector
public void postLayout() {
VPanel panel = getWidget();
if (uidlScrollTop != null) {
+ // IE / Safari fix for when scroll top is set to greater than panel
+ // height
+ int maxScroll = panel.getWidget().getOffsetHeight();
+ if (uidlScrollTop > maxScroll) {
+ uidlScrollTop = maxScroll;
+ }
panel.contentNode.setScrollTop(uidlScrollTop.intValue());
+
// Read actual value back to ensure update logic is correct
// TODO Does this trigger reflows?
panel.scrollTop = panel.contentNode.getScrollTop();