Skip to content

Regression Fix for #2357 the scrollPercentage is not correct #2425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jcompagner
Copy link
Contributor

if there are added rows, because then the scrollPercentage should be recalculated.

so its an enhancement on this fix:
bc2c68a

derrabus and others added 2 commits December 19, 2014 21:19
…t if there

are added rows, because then the scrollPercentage should be
recalculated.
@jcompagner
Copy link
Contributor Author

maybe there is a better way of doing this? But if there are added rows then the canvas size is getting bigger and the current stored percentage is not correct

for example look at the current code of http://ui-grid.info/docs/#/tutorial/212_infinite_scroll
if you scroll completely down then the scroll percentage is going to be "1" but at that time loads of new rows are added it so it should jump to lets say 0.7

In that example you can see that the screens is getting blank because of this, because the currentRow calculation is done with scroll percentage closed to 1

@c0bra
Copy link
Contributor

c0bra commented Dec 29, 2014

The fix seems to work well, but I'm hesitant to introduce more methods that have boolean flags as it's probably a code smell. In fact, we should probably refactor the ones we have.

What about breaking this into two methods, something like redrawAtScrollPercentage and redrawAtScrollPixels? Thoughts?

@jcompagner
Copy link
Contributor Author

that sounds nice to me.
I guess you can alter my fix? or do you need a pull request?

PaulL1 and others added 4 commits January 1, 2015 11:45
…er_scrolling

Fix angular-ui#2461: let the parent container scroll when the grid doesn't
…t if there

are added rows, because then the scrollPercentage should be
recalculated.
@c0bra
Copy link
Contributor

c0bra commented Feb 19, 2015

I've merged e497eac. Thanks @jcompagner!

@c0bra c0bra closed this Feb 19, 2015
@jcompagner jcompagner deleted the scrollpercentage_with_infinite_scrolling_fix branch February 26, 2015 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants