summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMatti Hosio <mhosio@vaadin.com>2015-01-14 12:13:31 +0200
committerVaadin Code Review <review@vaadin.com>2015-01-20 11:16:05 +0000
commit2a7fb2236cafe1ae0d1cb2fbd468c85b8a440e28 (patch)
tree930466ffdf686a01e5c833d95b0b6711ab3d5c0a /client
parentb8ae4fc242495cc805ac931d708c918893c06183 (diff)
downloadvaadin-framework-2a7fb2236cafe1ae0d1cb2fbd468c85b8a440e28.tar.gz
vaadin-framework-2a7fb2236cafe1ae0d1cb2fbd468c85b8a440e28.zip
Remove unnecessary scrollbar when zooming in or out (#15164)
Adds overflow-hidden in cases where scrollbars should not be needed Change-Id: Icee2444b0e7ee999fe49fadcb1598027453d49c5
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index 895ea9aa8f..48036a6399 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -6890,7 +6890,16 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
* visibleCellCount;
if (willHaveScrollbars()) {
totalExtraWidth += Util.getNativeScrollbarSize();
+ // if there will be vertical scrollbar, let's enable it
+ scrollBodyPanel.getElement().getStyle().clearOverflowY();
+ } else {
+ // if there is no need for vertical scrollbar, let's disable it
+ // this is necessary since sometimes the browsers insist showing
+ // the scrollbar even if the content would fit perfectly
+ scrollBodyPanel.getElement().getStyle()
+ .setOverflowY(Overflow.HIDDEN);
}
+
availW -= totalExtraWidth;
int forceScrollBodyWidth = -1;
@@ -6908,6 +6917,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
forceScrollBodyWidth = usedMinimumWidth + totalExtraWidth;
}
extraSpace = 0;
+ // if there will be horizontal scrollbar, let's enable it
+ scrollBodyPanel.getElement().getStyle().clearOverflowX();
+ } else {
+ // if there is no need for horizontal scrollbar, let's disable
+ // it
+ // this is necessary since sometimes the browsers insist showing
+ // the scrollbar even if the content would fit perfectly
+ scrollBodyPanel.getElement().getStyle()
+ .setOverflowX(Overflow.HIDDEN);
}
if (forceScrollBodyWidth > 0) {