react-native
react-native copied to clipboard
Text input cursor position IOS
Summary:
Paper
https://github.com/facebook/react-native/assets/48593211/96f8daac-e447-467f-96b2-7708f902d945
Fabric
https://github.com/facebook/react-native/assets/48593211/b010d4e7-3777-43fb-956a-673b725c15e7
Changelog:
[iOS] [Added] - Added {x, y} coordinates of text selection/cursor.
To achieve this, a new property has been added to track the cursor position, and the initializer has been updated to accept it. The conversion method has also been modified to parse this property from JSON and pass it to the updated initializer. This allows the code to handle cursor position alongside text selection information.
With this PR, the onSelectionChange method will now return the cursor position alongside the start and end positions, as follows:
selection: {
start: number,
end: number,
cursorPosition: {
start: {x: number, y: number},
end: {x: number, y: number}
}
}
Test Plan:
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 9,045,230 | -2,269 |
| android | hermes | armeabi-v7a | 8,294,652 | -2,269 |
| android | hermes | x86 | 9,561,533 | -2,257 |
| android | hermes | x86_64 | 9,403,741 | -2,207 |
| android | jsc | arm64-v8a | 9,604,770 | -1,445 |
| android | jsc | armeabi-v7a | 8,731,489 | -1,444 |
| android | jsc | x86 | 9,691,821 | -1,437 |
| android | jsc | x86_64 | 9,938,156 | -1,384 |
Base commit: 259a31689334968d607978c8d335c6da444cc253 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 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 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.