Repository navigation
Commit e9cdacc
Send TextInput color when props diffing is enabled
Summary:
`AndroidTextInputProps::getDiffProps` never sent `color`. The flat `color` field is not parsed, so the value is only available in `textAttributes.foregroundColor`. Existing text is colored by the attributed string in the state, but the native view kept its default text color, so text typed into an empty input ignored `color`. With a light `color` on a dark background the typed text was black.
This sends `color` from the text attributes, and `null` when it is removed so that `ReactTextInputManager` restores the default text color.
TextInput doesn't use props diffing yet: `getDiffPropsImplementationTarget()` returns `TextInput`, which doesn't match the `AndroidTextInput` component name. So the problem above only appears once that is enabled, and this change has no runtime effect until then.
Changelog:
[Internal] - Send TextInput color when props diffing is enabled
Test Plan:
`AndroidTextInputPropsDiffTest.colorIsSent` compares the props diffing payload with the raw props payload. It fails without this change and passes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 601fae6 commit e9cdacc
2 files changed
Lines changed: 22 additions & 0 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/components/textinput
- platform/android/react/renderer/components/androidtextinput
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
610 | 616 | | |
611 | 617 | | |
612 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
613 | 624 | | |
614 | 625 | | |
615 | 626 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
0 commit comments