react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Fix autoscrollToTopThreshold on iOS old arch

Open janicduplessis opened this issue 2 years ago • 1 comments

Summary:

Currently autoscrollToTopThreshold does not work correctly, it will scroll to top even when the scroll position is past the autoscrollToTopThreshold value.

The value of x/y is taken before we adjust the scroll position so we do not need to subtract the delta.

Note that this was already fixed when I ported this code to fabric, so this fix is only needed in the old arch code.

Changelog:

[IOS] [FIXED] - Fix autoscrollToTopThreshold on iOS old arch

Test Plan:

In RNTester example, threshold is set to 10, so it should not scroll to top if we are further than 10px from the top of the list.

Before:

https://github.com/facebook/react-native/assets/2677334/13723787-1bc4-4263-9bcb-91ddf7454de3

After:

https://github.com/facebook/react-native/assets/2677334/a8cfdaac-59fc-40de-970a-ff992366e25f

janicduplessis avatar Jul 07 '23 19:07 janicduplessis

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 9,001,856 +4
android hermes armeabi-v7a 8,255,912 +4
android hermes x86 9,510,995 +3
android hermes x86_64 9,356,876 +4
android jsc arm64-v8a 9,614,918 +6
android jsc armeabi-v7a 8,741,555 +1
android jsc x86 9,701,870 +5
android jsc x86_64 9,948,431 +3

Base commit: 1706066533f457ec79213f2813908b5624c220f6 Branch: main

analysis-bot avatar Jul 07 '23 19:07 analysis-bot

@cipolleschi could you have a look at this?

janicduplessis avatar Oct 18 '23 16:10 janicduplessis

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot avatar Oct 19 '23 08:10 facebook-github-bot

This pull request was successfully merged by @janicduplessis in 9666814750198574170a26e21a47b028f8060ffe.

When will my fix make it into a release? | Upcoming Releases

github-actions[bot] avatar Oct 24 '23 11:10 github-actions[bot]

@cipolleschi merged this pull request in facebook/react-native@9666814750198574170a26e21a47b028f8060ffe.

facebook-github-bot avatar Oct 24 '23 11:10 facebook-github-bot