Repository navigation
Commit a793487
Send null when removing TextInput returnKeyLabel, autoComplete and textAlign
Summary:
Removing these props sent an empty string, which `ReactTextInputManager` does not treat like the `null` sent by raw props. For `returnKeyLabel` it calls `setImeActionLabel("", ...)`, which sets a blank action label instead of clearing it. For `autoComplete` and `textAlign` the resulting state is the same, but each removal logs an "Invalid autoComplete" or "Invalid textAlign" warning.
These props now send `null` when removed. The other string props still send an empty string: their setters treat it like `null`, except `fontFamily`, where an empty string resets the typeface and `null` keeps the previous font family.
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 returnKeyLabel, autoComplete and textAlign
Test Plan:
`AndroidTextInputPropsDiffTest.removedStringsAreSentAsNull` 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 bae8a08 commit a793487
2 files changed
Lines changed: 21 additions & 3 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 | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
516 | 522 | | |
517 | 523 | | |
518 | 524 | | |
519 | | - | |
| 525 | + | |
520 | 526 | | |
521 | 527 | | |
522 | 528 | | |
523 | | - | |
| 529 | + | |
524 | 530 | | |
525 | 531 | | |
526 | 532 | | |
| |||
636 | 642 | | |
637 | 643 | | |
638 | 644 | | |
639 | | - | |
| 645 | + | |
640 | 646 | | |
641 | 647 | | |
642 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
0 commit comments