Skip to content

vertical scroll length should never be 0. This will result in division by 0 errors. #5740

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

Ladekarl
Copy link
Contributor

@Ladekarl Ladekarl commented Oct 13, 2016

If a grids viewport height, canvas height and scrollbar height has values so that the calculation:
canvas height - viewport height + scrollbar height returns 0, all the rows will dissapear when the grid is scrolled.

@dlgski
Copy link
Contributor

dlgski commented Oct 17, 2016

can you provide an issue/plunker?

@Ladekarl
Copy link
Contributor Author

Ladekarl commented Oct 20, 2016

Scroll the grid in this plunker all the way down, and then scroll it all the way up again.
The screen must have 1200 pixels in height (tested on 1600x1200 and 1920x1200 screens).
The chrome browser must be maximized.
Of course this issue can occur on other screen resolutions but the grid here is modified so that the issue occurs on screens with 1200 pixels in height.

http://run.plnkr.co/plunks/o8pfNE/

Before scroll:
image

After scroll:
image

@Ladekarl
Copy link
Contributor Author

Noticed the same calculation is done when scrolling horizontally. Updated the pull request to also fix horizontal scrolling

@mportuga
Copy link
Member

mportuga commented Nov 7, 2016

@Ladekarl I tried setting my browser window to the sizes that you mention and I don't have a scroll bar at those points. I also tried resizing my window as to get a scroll bar and I can't reproduce it.

@Ladekarl
Copy link
Contributor Author

Ladekarl commented Nov 7, 2016

@mportuga could be because the viewport isn't sized exactly the same because of bookmarks or whatever. However, it should be clear from the code that a division by 0 error is plausible. Do you want me to record a video for you?

@Ladekarl
Copy link
Contributor Author

Ladekarl commented Nov 8, 2016

I recorded a video: http://webmshare.com/jMJ1d

@dlgski dlgski merged commit 29c0a36 into angular-ui:master Nov 8, 2016
@Ladekarl Ladekarl deleted the fix-rendered-columns-zero-if-vertical-scrollbar-is-very-small branch November 8, 2016 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants