Repository navigation
Reset removed shadow, editable and persistentScrollbar props to their defaults - #59125
Open
YevheniiKotyrlo wants to merge 3 commits into
Open
YevheniiKotyrlo wants to merge 3 commits into
YevheniiKotyrlo wants to merge 3 commits into
Conversation
A Fantom case removes persistentScrollbar from a ScrollView, and gtests parse a removed shadowRadius, shadowOffset and editable, each expected to equal the value of a component that never set the prop.
… defaults A removed prop reaches the C++ props as null, and convertRawProp returns its fallback argument for it. shadowRadius, shadowOffset, editable, persistentScrollbar, sendMomentumEvents and nestedScrollEnabled passed a fallback other than their declared default, so a component that dropped the prop kept a value that a component which never set it does not have. Each fallback is now the declared default, which setProp already uses.
The target compiles every source below its path, so the gtest in textinput/tests needs the same exclusion the other targets give theirs.
Contributor
Author
Contributor
Author
|
The red iOS jobs come from one download: |
YevheniiKotyrlo
marked this pull request as ready for review
October 16, 2026 08:08
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D125706127. |
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:
A prop removed from a component reaches the C++ props as
null, andconvertRawPropthen returns its fallback argument. For these props the fallback differs from the field's declared default, so a component that had the prop and lost it is left with a value that a component which never had it does not have:shadowRadius30shadowOffset{width: 0, height: -3}{width: 0, height: 0}editable(TextInput)truefalsepersistentScrollbar(ScrollView)falsetruesendMomentumEvents,nestedScrollEnabled(Android ScrollView)falsetrueOn iOS,
RCTViewComponentViewapplies the shadow values to the layer, so a view that setsshadowRadiusorshadowOffsetconditionally (a raised card, a pressed state) getslayer.shadowRadius = 0andlayer.shadowOffset = {0, 0}once they are removed, instead of the defaults it started with. On Android, the props diff ofenablePropsUpdateReconciliationAndroidreads the same values, so aTextInputthat dropseditable={false}stays read-only and aScrollViewthat dropspersistentScrollbarkeeps it.ScrollViewalways passessendMomentumEventsandnestedScrollEnabled, so those two only reach a direct user of the native component.Each fallback is now the declared default, the value
setProp(enableCppPropsIteratorSetter) already resets these props to.Changelog:
[GENERAL] [FIXED] - Reset a removed
shadowRadius,shadowOffset,editableorpersistentScrollbarprop to its defaultTest Plan:
ViewPropsTestandBaseTextInputPropsTestparse a prop, then its removal, and compare the result with a default-constructed props object. Onmainthey fail withremoved.shadowRadius0 against 3,removed.shadowOffset.height0 against -3, andremoved.editablefalse against true.BaseTextInputPropshad no tests, sotextinput/tests/is new: the SwiftPM target excludes it as the other targets exclude theirs, and it needs a test target in the internal build.ScrollView-itest.jsrenderspersistentScrollbar={true}and then no prop; onmainthe second render still carriespersistentScrollbar="true".reactnativecommunity/react-native-androidimage, linking the gtests against the Fantom runner's ReactCommon build: the new tests fail onmainand pass with this change, and the whole Fantom suite passes with it. clang-format 21.1.2, Prettier, ESLint and Flow pass.mainand of this change on an iPad (iOS 27.0.1): a view that losesshadowRadiusandshadowOffsetdraws no shadow onmainand the default one with this change (before and after).