aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2014-08-18 14:45:27 +0300
committerVaadin Code Review <review@vaadin.com>2014-08-19 11:59:45 +0000
commite5589f90c922f776e240c3b2d5493af93242e56d (patch)
tree8d868f4124014362170eb68b73f69f1aff97095c /client
parent448619c5168603c134ad4d578bae1d577b00b543 (diff)
downloadvaadin-framework-e5589f90c922f776e240c3b2d5493af93242e56d.tar.gz
vaadin-framework-e5589f90c922f776e240c3b2d5493af93242e56d.zip
Fixes disappearing scrollbar bug (#13334)
Change-Id: I4d956c330d0fe5473911951cc17fd919424aa916
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java b/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
index 59583dcfec..5a54f5fc68 100644
--- a/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
+++ b/client/src/com/vaadin/client/ui/grid/ScrollbarBundle.java
@@ -271,13 +271,6 @@ abstract class ScrollbarBundle {
private ScrollbarBundle() {
root.appendChild(scrollSizeElement);
- Event.sinkEvents(root, Event.ONSCROLL);
- Event.setEventListener(root, new EventListener() {
- @Override
- public void onBrowserEvent(Event event) {
- invisibleScrollbarTemporaryResizer.show();
- }
- });
}
protected abstract int internalGetScrollSize();
@@ -517,6 +510,20 @@ abstract class ScrollbarBundle {
*/
public final void setScrollbarThickness(int px) {
isInvisibleScrollbar = (px == 0);
+
+ if (isInvisibleScrollbar) {
+ Event.sinkEvents(root, Event.ONSCROLL);
+ Event.setEventListener(root, new EventListener() {
+ @Override
+ public void onBrowserEvent(Event event) {
+ invisibleScrollbarTemporaryResizer.show();
+ }
+ });
+ } else {
+ Event.sinkEvents(root, 0);
+ Event.setEventListener(root, null);
+ }
+
internalSetScrollbarThickness(Math.max(1, px));
}