Skip to content
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

Fix regression of VirtualizedList jumpy header #22025

Closed
wants to merge 1 commit into from

Conversation

danilobuerger
Copy link
Contributor

Fixes #20956, #21361, #21198, #21468
Keeps the intended outcome of #18105

Test Plan:

See Video and Demo in #20956

Release Notes:

[GENERAL] [BUGFIX] [VirtualizedList] - Fix regression for jumpy header

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 30, 2018
Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code analysis results:

  • eslint found some issues.

@@ -805,7 +805,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
if (stickyIndicesFromProps.has(ii + stickyOffset)) {
const initBlock = this._getFrameMetricsApprox(lastInitialIndex);
const stickyBlock = this._getFrameMetricsApprox(ii);
const leadSpace = stickyBlock.offset - initBlock.offset;
const leadSpace =
stickyBlock.offset - initBlock.offset -

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier/prettier: Insert ⏎···············

@llostris
Copy link

llostris commented Dec 7, 2018

Considering there's a PR ready to fix this issue, is there anything we can do to help out in making it approved and merged?
It's affecting our app as well.

@danilobuerger
Copy link
Contributor Author

I still have a PR thats been open now for 8 months without a review, so I am not getting my hopes up for this one either. Its really disappointing how contributions are handled in this repository.

@wontonst
Copy link

I'm hitting this issue on prod and this PR resolves the issue, can we get eyes on this PR please?

@cjroth
Copy link

cjroth commented Dec 31, 2018

This fixes the issue for me as well, thank you! Would be great to see this merged.

@hamidhadi
Copy link

I tested these changes but the scroll is junkier than before 😐

@danilobuerger
Copy link
Contributor Author

@hamidhadi as someone else pointed out in your issue, maybe you just didn't implement getItemLayout correctly. It would be nice to continue that in your issue and not here.

@hamidhadi
Copy link

hamidhadi commented Jan 2, 2019

@danilobuerger I just shared my experience with your changes.
It seems my getItemLayout is working properly. Check it out

@danibonilha
Copy link
Contributor

@danibonilha I just shared my experience with your changes.
It seems my getItemLayout is working properly. Check it out

Hey @hamidhadi, it seems you tagged the wrong person.

cjroth added a commit to cjroth/react-native that referenced this pull request Jan 10, 2019
Copy link

@mjniday mjniday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the changes locally, and this works great!

@modeinnovations
Copy link

This PR has definitely improved the jumpy behaviour of my sectionList but unfortunately the issue persists.
On a 24 section list with 260 total items the headers hold together until about 2/3 of the way down, at which point the headers jump about 4 pixels (which is an improvement from jumping 100-200 pixels before).
Are there any changes I should be looking at to improve this? My best guess is it is something to do with the list not being able to render as fast as a user can scroll.
My getItemLayout prop is setup correctly and I'm using react-native-section-list-get-item-layout (Crazy long name).
Any thoughts would be appreciated. Not a huge issue but staring at it all day it starts to bug me.

@Freddy03h
Copy link
Contributor

@modeinnovations @hamidhadi It seem there is an issue using getItemLayout (in the libs or in your code, I don't know) because I have no more issue on a SectionList with 51 sections and 473 items without getItemLayout.

Personally I already use this fix on production since a month !

borisyankov added a commit to borisyankov/zulip-mobile that referenced this pull request Jan 22, 2019
borisyankov added a commit to borisyankov/zulip-mobile that referenced this pull request Jan 22, 2019
Fixes: zulip#3286 and zulip#3176

Related fix upstream but not ready to merge:
facebook/react-native#22025

A planed minor redesign (discussed with Rishi) to make the Unread
tabs less flashy and 'circus-colors-like' requires us to remove
the stickiness from the headers.

Even though though the design is still WIP, it makes sense to use
this change as a fix to an issue that was already reported multiple
times.

This makes the UnreadCards SectionList have normal, non-sticky
headers. We have to set `stickySectionHeadersEnabled` explicitly
to `false` as the defaults differ for iOS (true) and Android (false)
Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey everyone,

sorry we missed this for a long time. We promise to get better at reviewing and landing PRs. I'm gonna go ahead and ship this.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Feb 4, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@danilobuerger merged commit e4fd9ba into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 4, 2019
@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 4, 2019
erwamartin pushed a commit to erwamartin/react-native that referenced this pull request Feb 5, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
erwamartin pushed a commit to erwamartin/react-native that referenced this pull request Feb 7, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
matt-oakes pushed a commit to matt-oakes/react-native that referenced this pull request Feb 7, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
erwamartin pushed a commit to erwamartin/react-native that referenced this pull request Feb 21, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
sjchmiela pushed a commit to expo/react-native that referenced this pull request Mar 22, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
bruchim pushed a commit to wix-playground/react-native that referenced this pull request Mar 24, 2019
Summary:
Fixes facebook#20956, facebook#21361, facebook#21198, facebook#21468
Keeps the intended outcome of facebook#18105
Pull Request resolved: facebook#22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Impact: Regression Describes a behavior that used to work on a prior release, but stopped working recently. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.