Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
With
useTraitHiddenOnAndroidorenableViewCullingon, mounting a ScrollView on Android crashes withNoSuchKeyException: scrollAwayPaddingBottom.loadFabricScrollStatereadsscrollAwayPaddingBottomfrom the state data, but the C++ScrollViewStatenever had that field, sogetDynamic()doesn't include it and the value Kotlin writes inforceUpdateStategets dropped on the way back.This adds
scrollAwayPaddingBottomtoScrollViewStateand reads/writes it in the serializable state, the same wayscrollAwayPaddingTopalready works.Fixes #59654
Changelog:
[ANDROID] [FIXED] - Fix ScrollView crash with
NoSuchKeyException: scrollAwayPaddingBottomwhenuseTraitHiddenOnAndroidorenableViewCullingis onTest Plan:
Added a
ScrollViewStateTestcase (underRN_SERIALIZABLE_STATE) checking thatgetDynamic()includesscrollAwayPaddingBottomand that it survives a round trip through the dynamic constructor. I ran it locally against the header with Homebrew folly and gtest:Without the fix it doesn't compile, since the field doesn't exist. I updated the three Frameworks C++ API snapshots by hand and checked them against
python -m scripts.cxx-api.parser --validateoutput forScrollViewState. I also ran the repo's clang-format on both files. I didn't run the reproducer app on a device.