Skip to content

Commit

Permalink
Revert "MM-14791 Safari and FF takes an extra frame for scroll correc…
Browse files Browse the repository at this point in the history
…tion causing jump to the right post when loading more posts (mattermost#2556)" (mattermost#2560)

This reverts commit 742f772.
  • Loading branch information
sudheerDev authored and stevepartridge committed Mar 30, 2019
1 parent a589f6a commit cd51b07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 2 additions & 6 deletions components/post_view/post_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const POSTS_PER_PAGE = Constants.POST_CHUNK_SIZE / 2;
const MAX_NUMBER_OF_AUTO_RETRIES = 3;

const MAX_EXTRA_PAGES_LOADED = 10;
const OVERSCAN_COUNT_BACKWARD = window.OVERSCAN_COUNT_BACKWARD || 50; // Exposing the value for PM to test will be removed soon
const OVERSCAN_COUNT_FORWARD = window.OVERSCAN_COUNT_FORWARD || 100; // Exposing the value for PM to test will be removed soon
const HEIGHT_TRIGGER_FOR_MORE_POSTS = window.HEIGHT_TRIGGER_FOR_MORE_POSTS || 1000; // Exposing the value for PM to test will be removed soon

export default class PostList extends React.PureComponent {
static propTypes = {
Expand Down Expand Up @@ -300,7 +297,7 @@ export default class PostList extends React.PureComponent {
onScroll = ({scrollDirection, scrollOffset, scrollUpdateWasRequested}) => {
const isNotLoadingPosts = !this.state.postsLoading && !this.loadingPosts;
const didUserScrollBackwards = scrollDirection === 'backward' && !scrollUpdateWasRequested;
const isOffsetWithInRange = scrollOffset < HEIGHT_TRIGGER_FOR_MORE_POSTS;
const isOffsetWithInRange = scrollOffset < 1000;
if (isNotLoadingPosts && didUserScrollBackwards && isOffsetWithInRange && !this.state.atEnd) {
this.loadingPosts = true;
this.loadMorePosts();
Expand Down Expand Up @@ -474,8 +471,7 @@ export default class PostList extends React.PureComponent {
itemCount={this.state.postListIds.length}
itemData={this.state.postListIds}
itemKey={this.itemKey}
overscanCountForward={OVERSCAN_COUNT_FORWARD}
overscanCountBackward={OVERSCAN_COUNT_BACKWARD}
overscanCount={100}
onScroll={this.onScroll}
onItemsRendered={this.onItemsRendered}
initScrollToIndex={this.initScrollToIndex}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"react-select": "2.4.1",
"react-transition-group": "2.6.0",
"react-virtualized-auto-sizer": "^1.0.2",
"react-window": "github:sudheerDev/react-window#e1c298a26c7db32253ba332bc2057dd242d5d8cd",
"react-window": "github:sudheerDev/react-window#ccf30388a1a6a7582e0d0573d4cd24d5776ebbaa",
"rebound": "0.1.0",
"redux": "4.0.1",
"redux-batched-actions": "0.4.1",
Expand Down

0 comments on commit cd51b07

Please sign in to comment.