-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fixed scrollPercent calculation for GridRenderContainer and InfiniteScroll Feature #5395
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
…the Feature Infinite Scroll. fixes for angular-ui#5211 and angular-ui#4508
@@ -22,6 +22,16 @@ | |||
*/ | |||
module.service('uiGridInfiniteScrollService', ['gridUtil', '$compile', '$timeout', 'uiGridConstants', 'ScrollEvent', '$q', function (gridUtil, $compile, $timeout, uiGridConstants, ScrollEvent, $q) { | |||
|
|||
|
|||
// not sure where to put this util function @vance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could move this to the GridRenderContainer class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehh. splitting time between a fortune 500 a startup and marketing my own side-app at the moment. I don't know the next time I will have the headspace to compile this again, christmas time?
Any news on this fix? One of my applications seems to be affected by it. |
Any word on this getting merged into master? |
I'll take this as a compliment. Seems like the PR is just dinged for being complex? I'm not sure how to make a less-complex fix for one of the most complex parts of this library. It took 2 days to get my brain into the space where I could understand the problem, let alone fix it. There's no way I could refactor it now, if that's even possible to do so without increasing the complexity. So, does the project want to fix a fatal bug that essentially breaks all expandable row templates, or reject a PR because it is complex? I'm not sure, I don't maintain libraries of this size. |
For anyone in a pinch, i made a gist of the compiled code. I've been using this fix in production for weeks with no issues. |
@vance Can you please fix unit tests? |
Does CI not run the tests? Er, what tests are breaking? I tried running |
Any news on this PR? |
I see the removed needs fixed test... I don't recall any tests breaking. I did not have time to add new tests as I already went over my budget fixing this. But I don't think that should prevent a merge. Anyone else besides me manually verify correctness of the expanded row calculations? I'm running this in prod with no issues. |
@vance In your Gist: |
Oh, sorry. I guess Gist has a limit of about 1MB. I put it on my server, here: http://www.foreverscape.com/angular-grid-ui-exp-fix.js |
Bump @mportuga |
// var totalNumRowsToRender = Math.min(rowCache.length,rowIndex + minRows + self.grid.options.excessRows); | ||
|
||
//TODO: @vance calculate and appropriate end... doesn't break things, just show more rows than necessary here. | ||
var rangeEnd = rowCache.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing more rows than necessary is considered a defect for some companies. Can you describe what you mean by that? Will the scrolling end, or will it just keep going since this is the infinite scroll library?
|
||
self.updateViewableColumnRange(newRange); | ||
// Define a max row index that we can't scroll past |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code seems to be describing a max column index, not a max row index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not added by me, maybe moved.
if (!(typeof(scrollTop) === 'undefined' || scrollTop === null)) { | ||
// Have we hit the threshold going down? | ||
if ( !self.grid.suppressParentScrollDown && self.prevScrollTop < scrollTop && rowIndex < self.prevRowScrollIndex + self.grid.options.scrollThreshold && rowIndex < maxRowIndex) { | ||
console.log('returning first bail'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should comment this out, we don't want the grid logging this in production.
} | ||
//Have we hit the threshold going up? | ||
if ( !self.grid.suppressParentScrollUp && self.prevScrollTop > scrollTop && rowIndex > self.prevRowScrollIndex - self.grid.options.scrollThreshold && rowIndex < maxRowIndex) { | ||
console.log('returning second bail'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should comment this out, we don't want the grid logging this in production.
vance, I can't thank you enough, that fix was critical to our project. I hope the patch will be merged soon. |
@dlgski This appears to be good and it will fix a big issue for many people. Since we are planning a major update, maybe now is the time to take this? |
@vance Can you resolve merge conflict? |
Nope. It took me two full days to solve this. I was told to fix tests that On Wed, Nov 16, 2016 at 10:35 AM Marcelo Sauerbrunn Portugal <
|
Closing since the developer needs more time to fix it up. |
Any updates on this? |
any updates on merging this ? my application is affected by the same issue. it would be good if you can merge. this would solve problem to many. |
This was closed due to inactivity, i will reopen and see if I can finish the work |
After reviewing this code, I realized that it does not actually address the problem in an acceptable way. All this code really does in the end is get rid of the virtualization, which would be horrible for performance. |
It does affect the efficiency. with this code the page loading become little slow. Is there any other solution for this issue? |
None that I am aware off, and unfortunately, I don't know when I will have enough time to look at this more throughly. I will certainly accept other pull requests if someone else finds it, but for the next couple of weeks, I will be traveling out of the country, followed shortly by moving to a new place, so I won't have much time to look into ui-grid. |
@mportuga any update on this bugs ? |
|
||
} else { | ||
var maxLen = self.visibleRowCache.length; | ||
newRange = rowCache.length;//[0, Math.max(maxLen, minRows + self.grid.options.excessRows)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mportuga This is the line you were looking for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means that this PR is invalid. It simply removes the virtual scrolling
fixed scrollPercent calculation for GridRenderContainer and InfiniteScroll Feature
fixes for
#5211
and
#4508