feat: include information about text range changes in onChange
Summary:
This Pr provides a solution to:
- https://github.com/facebook/react-native/issues/37722
By providing further information about the range in which a text has been changed in the onChange event users are able to implement <TextInputs /> that only apply partial text updates, thus avoiding race condition issues between the main/UI and JS thread.
Changelog:
[ANDROID] [ADDED] - Add start, before, count info to the Textinput's onChange event
[IOS] [ADDED] - Add start, before, count info to the Textinput's onChange event
Test Plan:
I added an example to the rn-tester app.
https://github.com/facebook/react-native/assets/16821682/a7d2cc1c-43cc-4046-a30c-9602faef449f
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 20,300,899 | +337 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 23,497,495 | +121 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: c25246044f51b770ff1e090d6b4ec78d41ec917f Branch: main
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.