Add selection to TextInputChangeEventData in TypeScript types#57249
Add selection to TextInputChangeEventData in TypeScript types#57249nsbarsukov wants to merge 1 commit into
selection to TextInputChangeEventData in TypeScript types#57249Conversation
The native onChange event was updated to emit selection data (162627a) and the JS companion (c1f5445) added the corresponding types to the Flow source (TextInput.flow.js) and the generated ReactNativeApi.d.ts, but it missed the legacy hand-written TextInput.d.ts. This adds the optional selection field there so all three type sources agree.
|
Hi @nsbarsukov! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary:
The native
TextInput.onChangeevent now emitsselectiondata (cursor location) on both iOS and Android, added in 162627a (#55044).The JS companion PR c1f5445 (#55043) added the corresponding types, but only to two of the three TypeScript/Flow type sources:
selection?TextInput.flow.js(Flow)ReactNativeApi.d.ts(generated API surface)TextInput.d.ts(legacy public.d.ts)The hand-written legacy
TextInput.d.tswas missed, so consumers relying on it can't accessselectionfrom theonChangeevent even though native genuinely sends it. This PR adds the optionalselectionfield there so all three type sources agree.Changelog:
[GENERAL] [ADDED] - Add
selectiontoTextInputChangeEventDatain TypeScript typesTest Plan:
Type-only change.
selectionis now available and correctly typed on theonChangeevent: