ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Issues With Scrolling (The Bouncing Scrollbar)

Open mikehuebner opened this issue 11 years ago • 5 comments

Hello all!

I have some good new and bad new, good new I found a bug! Bad news, it has to do with virtualization...

So I started exploring why this issue I had started happening.

Issue: Our scrollbar was bouncing due to the rowHeight not being set, so we set the row height to no avail so I started exploring what makes the scrollbar, scroll.

Solution: Line 2521 to 2529 there is this if statement that depends on the delta not being 0 in anyway shape or form. If this is true, move on I guess? It was blank. And otherwise, preventDefault and send a blank event to some where in the code. (this is referencing the build file).

// Let the parent container scroll if the grid is already at the top/bottom
              if ((event.deltaY !== 0 && (scrollEvent.atTop(scrollTop) || scrollEvent.atBottom(scrollTop))) ||
                  (event.deltaX !== 0 && (scrollEvent.atLeft(scrollLeft) || scrollEvent.atRight(scrollLeft)))) {
                //parent controller scrolls
              }
              else {
                event.preventDefault();
                scrollEvent.fireThrottledScrollingEvent('', scrollEvent);
              }

What I realized is this turn off virtualization of the grid, pretty much completely. But fixes all scrolling issues I was having relating to scrolling. This is not a solution but a work around for small grids, and these are just my observations. I did not see any comments really wrapping this code about whether this will be looked at in the future or not. But wanted to bring it up!

mikehuebner avatar Aug 04 '15 05:08 mikehuebner

can you create a plunker to recreate the issue you are seeing?

swalters avatar Aug 04 '15 19:08 swalters

Hello @swalters ,

I am also facing the same problem. There appears a bouncing effect when I want to scroll to the end of the page. But when I exclude the code between line 2521 to 2529, then the problem is solved. I recorded the issue as a gif, but in real the bouncing effect is much faster. (i.e, gif is not able to show it due to fps limit)

http://g.recordit.co/V0DhICwMze.gif

bozkan avatar Nov 09 '15 10:11 bozkan

@bozkan, could you please build a plunker showing this behaviour?

imbalind avatar Nov 09 '15 18:11 imbalind

This issue is still present. Are there any plans in resolving this issue?

EricHeesakkers avatar Sep 09 '16 14:09 EricHeesakkers

please provide a plunker, and if you have as solution, the plunker alongside a PR would be appreciated

dlgski avatar Sep 12 '16 10:09 dlgski