-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Update network inspector to have smarter scroll stickiness #21952
Update network inspector to have smarter scroll stickiness #21952
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
this._requestsListView = listRef; | ||
}; | ||
|
||
_requestsListViewOnScroll = (e: Object): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about?
_requestsListViewOnScroll = (e: Object): void => { | |
_requestsListViewOnScroll = (e: Object): void => { | |
this._requestsListViewScrollMetrics = { | |
offset: e.nativeEvent.contentOffset.y, | |
visibleLength: e.nativeEvent.layoutMeasurement.height, | |
contentLength: e.nativeEvent.contentSize.height, | |
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship this!
There was a problem hiding this 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.
@AlanFoster merged commit c06473a into |
…21952) Summary: When making use of the network inspector on a react-native app, it can be quite annoying that as new requests come in the network inspector instantly sticks to the bottom. This PR makes this logic smarter by allowing the user to be scrolled away from the bottom by two rows to override this automatic scrolling to the bottom logic. Pull Request resolved: facebook#21952 Differential Revision: D14162762 Pulled By: cpojer fbshipit-source-id: ad49858509dd74a817ebabab54fdacc99773bf22
Summary: When making use of the network inspector on a react-native app, it can be quite annoying that as new requests come in the network inspector instantly sticks to the bottom. This PR makes this logic smarter by allowing the user to be scrolled away from the bottom by two rows to override this automatic scrolling to the bottom logic. Pull Request resolved: #21952 Differential Revision: D14162762 Pulled By: cpojer fbshipit-source-id: ad49858509dd74a817ebabab54fdacc99773bf22
When making use of the network inspector on a react-native app, it can be quite annoying that as new requests come in the network inspector instantly sticks to the bottom.
This PR makes this logic smarter by allowing the user to be scrolled away from the bottom by two rows to override this automatic scrolling to the bottom logic.
Test Plan:
Scenario 1: Being close to the bottom
Given the user has not scrolled away from the bottom
When a new network requests come in
Then the new request should be scrolled to
Scenario 2: Intentionally scrolling away
Given the user has scrolled away from the bottom
When a new network request comes in
Then the new request should not be scrolled to
but the scroll bars should highlight to notify additional requests have been made
GIF depicts testing the first scenario of scrolling to the bottom when new requests arrive, followed by testing the scenario scenario of being scrolled away from the bottom
Release Notes:
Help reviewers and the release process by writing your own release notes. See below for an example.
[GENERAL] [ENHANCEMENT] [Network Inspector] - The network inspector has been updated to no longer automatically scroll to the bottom if you have intentionally moved away