Repository navigation
Commit 3a3b8bf
Send null when removing TextInput color props with props diffing
Summary:
Removing `placeholderTextColor`, `selectionColor`, `selectionHandleColor`, `cursorColor` or `underlineColorAndroid` sent the value of the unset `SharedColor`, which is 0. `ReactTextInputManager` treats 0 as transparent and only restores the platform default for `null`, so the placeholder, the selection highlight, the handles or the cursor became invisible.
These props now send `null` when removed, the same as raw props. An explicit `transparent` is still sent as 0. `textShadowColor` used the same pattern and is changed with them, although `ReactTextInputManager` has no setter for it.
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 null when removing TextInput color props with props diffing
Test Plan:
`AndroidTextInputPropsDiffTest.removedColorsAreSentAsNull` 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 e9cdacc commit 3a3b8bf
2 files changed
Lines changed: 22 additions & 6 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 | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
| 461 | + | |
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
42 | 58 | | |
43 | 59 | | |
44 | 60 | | |
0 commit comments