scrollToIfNecessary sets bottomBound as NaN
In ui-grid - v3.0.0-rc.22 I am trying to execute the scrollTo functionality. When I hit line 5280:
var bottomBound = self.renderContainers.body.prevScrollTop + self.gridHeight - self.renderContainers.body.headerHeight - self.footerHeight - self.scrollbarWidth;
the value for 'self.renderContainers.body.headerHeight' is undefined which causes the 'bottomBound' to be set to 'NaN'. It seems like the value used here should instead be 'self.headerHeight' which is used to set the 'topBound' on line 5270.
Am I either incorrect in that the value should be switched or am I doing something else that causes self.renderContainers.body.headerHeight to be 'undefined'?
Don't you want to fix this? 1.5 years have passed since the bug was reported.
There are a lot of bugs that meet that criteria right now, but most of the grid team that was here at that time is currently inactive due to being busy. We will try to address this, but first we are trying to sort through our bug back log to weed out things that are not real bugs, or no longer bugs
@mportuga, I understand you. But it is absolutely bug and it is actual right now. What if I make PR by myself? It will not be so complex.
PRs are welcome!
But what about 3.x version? Do you still support it? I don't use angular >= 1.5 in my app, so I cannot update ui-grid to 4,x.
4.0 is for Angular >= 1.4
@dlgski As I see here, all mentions are about angular >= 1.5. And when I tried to update angular-ui-grid to the latest version, npm installed [email protected] inside angular-ui-grid.
hmm, technically version 3.x is no longer receiving updates. So even if you make a PR, it will end up somewhere in 4.x. And I am sorry for the misunderstanding. I do agree that this is a bug, otherwise I would have closed it. What I meant is that the fact that this bug is 1.5 years old, does not guarantee priority. Unfortunately, since we have over 1 thousand bugs right now, it is very hard to prioritize, but we are certainly accepting PRs.
This bug still appears in 4.0.2.
Looks like scrollIfNecessary() is called whereas refreshCanvas() has not finished is job yet.
The following line, particularly, is wrapped in a $timeout function and may execute after scrollIfNecessary() is actually executed:
…
if (container.header) {
var headerHeight = container.headerHeight = getHeight(container.headerHeight, parseInt(gridUtil.outerElementHeight(container.header), 10));
…
For what it's worth, I have also wrapped the call to scrollIfNecessary() (actually the scrollTo() function which in turn calls scrollIfNecessary()) in a $timeout function, as a workaround.