Skip to content

Commit dad2849

Browse files
committed
Add selection to TextInputChangeEventData in TypeScript types
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.
1 parent 0cdb59f commit dad2849

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/react-native/Libraries/Components/TextInput/TextInput.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ export type TextInputKeyPressEvent =
515515
export interface TextInputChangeEventData extends TargetedEvent {
516516
eventCount: number;
517517
text: string;
518+
selection?: {
519+
start: number;
520+
end: number;
521+
};
518522
}
519523

520524
/**

0 commit comments

Comments
 (0)