Skip to content

Commit

Permalink
minor changes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed May 4, 2023
1 parent 031d5ba commit 2cbd5a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,14 @@ export interface TextInputProps
/**
* Allows to adjust caret height.
* The default value is 0, which means the height of the caret will be calculated automatically
* @platform ios
*/
caretHeight?: number | undefined;

/**
* Allows to adjust caret postiion relative to the Y axis
* Allows to adjust caret position relative to the Y axis
* The default value is 0.
* @platform ios
*/
caretYOffset?: number | undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,14 @@ export type Props = $ReadOnly<{|
/**
* Allows to adjust caret height.
* The default value is 0, which means the height of the caret will be calculated automatically
* @platform ios
*/

caretYOffset?: ?number,

/**
* Allows to adjust caret postiion relative to the Y axis
* Allows to adjust caret position relative to the Y axis
* The default value is 0.
* @platform ios
*/
caretYHeight?: ?number,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,14 @@ type IOSProps = $ReadOnly<{|
/**
* Allows to adjust caret height.
* The default value is 0, which means the height of the caret will be calculated automatically
* @platform ios
*/
caretYOffset?: ?number,

/**
* Allows to adjust caret postiion relative to the Y axis
* Allows to adjust caret position relative to the Y axis
* The default value is 0.
* @platform ios
*/
caretHeight?: ?number,
|}>;
Expand Down Expand Up @@ -1459,8 +1461,6 @@ function InternalTextInput(props: Props): React.Node {
selection={selection}
style={style}
text={text}
caretYOffset={props.caretYOffset}
caretHeight={props.caretHeight}
/>
);
} else if (Platform.OS === 'android') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,11 @@ - (CGRect)caretRectForPosition:(UITextPosition *)position
originalRect.origin.y += _caretYOffset;
}

if(_caretHeight != 0) {
if(_caretHeight != 0) {
originalRect.size.height = _caretHeight;
}
return originalRect;

return originalRect;
}

- (NSArray *)selectionRectsForRange:(UITextRange *)range {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ class TextInputTraits final {
* iOS-only (inherently iOS-specific)
* Default value: 0 with a default font.
*/

int caretHeight{0};

/*
Expand Down

0 comments on commit 2cbd5a3

Please sign in to comment.