diff options
author | Olli Tietäväinen <ollit@vaadin.com> | 2017-04-13 10:56:25 +0300 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2017-04-13 09:56:25 +0200 |
commit | cf93a67297f8936cd3b6456806bcc4a1e804a732 (patch) | |
tree | 636d053b188d4b54cfd5c3ad17eed037c3d2bfcd /client | |
parent | 22c39d36f81a6d37f729d67135487ef10cb8dc5a (diff) | |
download | vaadin-framework-cf93a67297f8936cd3b6456806bcc4a1e804a732.tar.gz vaadin-framework-cf93a67297f8936cd3b6456806bcc4a1e804a732.zip |
Panel.setScrollTop() fails with impossibly large numbers
Fixes #1149
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/panel/PanelConnector.java | 7 |
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 2e5237598f..5e22b9ef32 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(); |