Skip to content

Send null when removing TextInput fontSize with props diffing - #60074

Open
coado wants to merge 1 commit into
coado/textinput-diffing-03-color-removalfrom
coado/textinput-diffing-04-font-size
Open

coado wants to merge 1 commit into
coado/textinput-diffing-03-color-removalfrom
coado/textinput-diffing-04-font-size

Conversation

@coado

@coado coado commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

When props diffing is enabled, removing the fontSize prop sends 0, which hides the placeholder and new text. After this change, it sends null, so the native default font size is used, the same as with raw props.

Changelog:

[Internal] - Send null when removing TextInput fontSize with props diffing

Test Plan:

Added AndroidTextInputPropsDiffTest.removedFontSizeIsSentAsNull test.

Stack:

🤖 Generated with Claude Code

Summary:
`fontSize` was sent from a flat field that defaults to 0, so removing it called `setFontSize(0)` and made the placeholder and any new text invisible.

This sends `fontSize` from `textAttributes.fontSize`, which is NaN when unset, and sends `null` when it is removed. `ReactTextInputManager` then applies its default font size, the same as with raw props. It also means an explicit `fontSize: 0` is now sent like any other value.

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 fontSize with props diffing

Test Plan:
`AndroidTextInputPropsDiffTest.removedFontSizeIsSentAsNull` 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>
@coado
coado force-pushed the coado/textinput-diffing-04-font-size branch 2 times, most recently from 753a0ef to 6deaee7 Compare November 27, 2026 18:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants