fix(android): crash when setting a percentage borderRadius on Text, TextInput, and ScrollView - #57869
Open
sbaiahmed1 wants to merge 1 commit into
Open
Conversation
…and ScrollView (Android)
Percentage border radii arrive from JS as strings ('50%'), but the
borderRadius @ReactPropGroup setters in ReactTextViewManager,
PreparedLayoutTextViewManager, ReactTextInputManager,
ReactScrollViewManager, ReactHorizontalScrollViewManager, and
ReactNestedScrollViewManager still typed the prop as Float, so the
reflection-based property updater crashed with "java.lang.String cannot
be cast to java.lang.Double":
JSApplicationIllegalArgumentException: Error while updating property
'borderRadius' of a view managed by: RCTText
Accept a Dynamic and parse it with LengthPercentage.setFromDynamic,
completing the migration ReactViewManager received in 0.75 and
ReactImageManager in react#57795. The Float overloads on the public managers
are kept as deprecated pass-throughs for backward compatibility; the two
internal managers (PreparedLayoutTextViewManager,
ReactNestedScrollViewManager) are migrated outright.
Changelog:
[ANDROID] [FIXED] - Fix crash when setting a percentage borderRadius on Text, TextInput, and ScrollView
Contributor
Author
I dont understand |
sbaiahmed1
force-pushed
the
fix/percentage-border-radius-view-managers
branch
from
August 9, 2026 12:36
e51dae8 to
b69ad52
Compare
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
Follow-up to #57795, which fixed the percentage-
borderRadiuscrash for<Image>(#53977). The same latent bug existed in every remaining Android view manager whoseborderRadius@ReactPropGroupsetter was still typed asFloat:ReactTextViewManager(<Text>)PreparedLayoutTextViewManager(internal, prepared-layout<Text>)ReactTextInputManager(<TextInput>)ReactScrollViewManager(<ScrollView>)ReactHorizontalScrollViewManager(<ScrollView horizontal>)ReactNestedScrollViewManager(internal, nested-scroll variant)Percentage border radii arrive from JS as strings (
'50%'), so the reflection-based property updater throws:Each setter now accepts a
Dynamicparsed withLengthPercentage.setFromDynamic, completing the migrationReactViewManagerreceived in 0.75 andReactImageManagerin #57795. TheFloatoverloads on the four public managers are kept as deprecated pass-throughs for source/binary compatibility (public API dump updated); the two internal managers are migrated outright. Rendering needs no changes since all six managers already delegate toBackgroundStyleApplicator, which resolves percentages.Changelog:
[ANDROID] [FIXED] - Fix crash when setting a percentage borderRadius on Text, TextInput, and ScrollView
Test Plan
Unit tests — new Robolectric regression tests mirroring the one merged in #57795:
ReactTextViewPropertyTest.testBorderRadius(new file)ReactTextInputPropertyTest.testBorderRadiusBoth verified red before the fix (failing with
JSApplicationIllegalArgumentException: Error while updating property 'borderRadius' of a view managed by: RCTText) and green after (:packages:react-native:ReactAndroid:testDebugUnitTest, 25/25 passing).Manual QA — rn-tester on an Android emulator (API 35), rendering the snippet below with
borderRadius: '50%'on<Text>and'20%'on<TextInput>,<ScrollView>, and<ScrollView horizontal>:On main this screen crashes with the exception above; with this change all four render rounded corners.
Screenshots