react-native-windows icon indicating copy to clipboard operation
react-native-windows copied to clipboard

[Bug Fix][Fabric] Fix onChangeText firing twice when first typing in TextInput

Open HariniMalothu17 opened this issue 7 months ago • 0 comments

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

In Fabric TextInput, when a user types a single character, the onChangeText callback was being triggered twice instead of once. This was inconsistent with Paper TextInput behavior and could cause issues in applications that rely on accurate change event counts.

Resolves [https://github.com/microsoft/react-native-windows/issues/12780 ]

What

The new solution uses text-based deduplication - it only emits onChange when the current text differs from the last text for which onChange was emitted. This prevents duplicate onChange events while preserving all expected onChange behavior.

Screenshots

(image)

Testing

E2E test ran succesfully

Changelog

yes

Add a brief summary of the change to use in the release notes for the next release.

Microsoft Reviewers: Open in CodeFlow

HariniMalothu17 avatar Jun 17 '25 10:06 HariniMalothu17