Skip to content

Conversation

@nihgwu
Copy link
Contributor

@nihgwu nihgwu commented Aug 21, 2019

fix the issue described in #76 , that's a regression introduced in #73, the following is the I left for the initial fix to move the methods in a setTimeout:

// if the table is in `fixed` mode, it could be scrolled horizontally, in that case,
// the horizontal scroll position would be unexpected if the `align` is not `start`,
// so we reset the horizontal scroll to the previous value in that case,
// and the two scroll methods would be batched on event callback, and the `onScroll` event will be called after that,
// then it will be reset to the original position as the `this._scroll` is not synced to the new state,
// so we put them in a `setTimeout` to make `onScroll` be called before we set the horizontal position.

but actually it will break in concurrent mode as the batched behavior is not only for event callback, but we are not concurrent mode ready as we used cWRP, so the current workaround is OK, for long term we probably have to implement my own align logic to solve the problem

UPDATE: just read the source code of react-window, we don't need to implement our own align logic anymore

@nihgwu nihgwu merged commit 1caede2 into master Aug 21, 2019
@nihgwu nihgwu deleted the neo/fix-scroll-to-row branch August 21, 2019 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants