-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] add caretHeight and caretYoffset to TextInput component #37147 #58
base: ExpensifyRC1-0.72.0-alpha.0
Are you sure you want to change the base?
[iOS] add caretHeight and caretYoffset to TextInput component #37147 #58
Conversation
@@ -38,6 +38,8 @@ void RCTCopyBackedTextInput( | |||
toTextInput.keyboardAppearance = fromTextInput.keyboardAppearance; | |||
toTextInput.spellCheckingType = fromTextInput.spellCheckingType; | |||
toTextInput.caretHidden = fromTextInput.caretHidden; | |||
toTextInput.caretYOffset = fromTextInput.caretYOffset; | |||
toTextInput.caretHeight = toTextInput.caretHeight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't be toTextInput.caretHeight = fromTextInput.caretHeight
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! Fixed :-)
0f17587
to
b85913b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding myself as a reviewer!
Looking good so far, I'll test it out tomorrow. Sorry missing track of these, can anyone mention me here so I can pin the notifications to keep track of it. |
@Santhosh-Sellavel here's your ping |
Looks great! Simulator.Screen.Recording.-.iPhone.14.-.2023-05-31.at.00.52.53.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I have not seen that before. Looks like its normally skipped. Will ask around |
@@ -368,6 +368,19 @@ type IOSProps = $ReadOnly<{| | |||
* @platform ios | |||
*/ | |||
smartInsertDelete?: ?boolean, | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: Missing a blank line before this comment
@@ -13,6 +13,41 @@ | |||
#import <React/RCTBackedTextInputDelegateAdapter.h> | |||
#import <React/RCTTextAttributes.h> | |||
|
|||
//the UITextSelectionRect subclass needs to be created because the original version is not writable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB:
//the UITextSelectionRect subclass needs to be created because the original version is not writable | |
// the UITextSelectionRect subclass needs to be created because the original version is not writable |
Tested well, we can ignore the @OlimpiaZurek Can you update the base to be |
Please target |
@OlimpiaZurek bump! |
1 similar comment
@OlimpiaZurek bump! |
@alex-mechler Can you give a bump on any internal channels for callstack! |
Actually, we might not need to, based on. https://expensify.slack.com/archives/C01GTK53T8Q/p1686159512184629. We are moving towards deprecating our fork of RN |
FYI I have bumped the upstream PR with Meta |
@AndrewGable Can you bump again? |
@OlimpiaZurek - Can you fix the upstream PR's conflicts and then I can reach out again? Thanks. |
Or @koko57 since you might have access to the fork? Thanks |
Yes, I will take care of this tomorrow 😊 |
@AndrewGable all conflicts are resolved in the upstream PR, the target branch is changed here for |
Thank you, bumped the upstream PR for a review via Discord! |
@AndrewGable Still no review. Can you bump them again, thanks! |
Upstream PR Link
facebook#37147
Summary
This PR adds support for the
caretHeight
andcaretPosition
properties in iOS multi-line TextInput. Based on these values, we can calculate the caret position and height and adjust them in the appl so that the cursor does not overlap the previous line of text.Changelog
[IOS] [ADDED] - caretHeight and caretPosition for multiline TextInput component
Test Plan
Default caret:
default_caret.mov
Caret with
caretHeight
andcaretYOffset
adjustment:adjusting_caret.mov