calculated scrollable range and bounds to prevent overscroll#51795
calculated scrollable range and bounds to prevent overscroll#51795nohabean wants to merge 1 commit into
Conversation
|
Hi @nohabean! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign 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 to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
A couple of bits come to mind.
How are these bounds derived normally for a fling? Either by RN, or by Android ScrollView? |
|
This PR is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label. |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
Summary:
This PR fixes an issue in the fling behavior where OverScroller could cause overscroll due to an unbounded scroll range. The existing implementation used Integer.MAX_VALUE as the max scroll limit.
The proposed change calculates the actual scrollable range using computeVerticalScrollRange() and clamps the fling bounds based on the result. This prevents scrolling beyond content limits.
Changelog:
[ANDROID] [FIXED] - Prevents overscroll during fling by calculating and applying scrollable bounds based on the scrollable range.
Test Plan:
Manually tested fling behavior in a ScrollView with varying content lengths.
Verified that fling stops at the correct content boundary and does not scroll beyond the visible area.