When restoring scrollFocus, a row that was previously on top, is now on the bottom of grid
#5,911 建立於 2016年12月22日
倉庫指標
- Star
- (5,395 star)
- PR 合併指標
- (30 天內沒有已合併 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