When restoring scrollFocus, a row that was previously on top, is now on the bottom of grid
#5,911 opened on 2016年12月22日
Repository metrics
- Stars
- (5,395 stars)
- PR merge metrics
- (30d に merged PR はありません)
説明
I have a grid that's sitting inside a non-modal, I use saveState so I can destroy and recreate the grid.
I'm expecting the row that was the first row to be at the top when restoring, however it appears on the bottom of the grid.
I looked around in ui-grid.js (4.0.1), and noticed that in Grid.prototype.scrollIfNecessary when calculating the "scrollPixels", you deduct(-) the "bottomBound".
If I replace the bottomBound with my rowHeight, I get the expected result.
I might be doing something wrong, but if not, a fix is needed.
EDIT: The issue occurs only when the row that was before on top is below the current view port when restoring the state, as in - pixelsToSeeRow > bottomBound, This is happening in http://ui-grid.info/docs/#/tutorial/208_save_state as well