Skip to content

Commit b85913b

Browse files
committed
minor changes after code review
1 parent 6513a91 commit b85913b

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

Libraries/Components/TextInput/TextInput.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,12 +576,14 @@ export interface TextInputProps
576576
/**
577577
* Allows to adjust caret height.
578578
* The default value is 0, which means the height of the caret will be calculated automatically
579+
* @platform ios
579580
*/
580581
caretHeight?: number | undefined;
581582

582583
/**
583-
* Allows to adjust caret postiion relative to the Y axis
584+
* Allows to adjust caret position relative to the Y axis
584585
* The default value is 0.
586+
* @platform ios
585587
*/
586588
caretYOffset?: number | undefined;
587589

Libraries/Components/TextInput/TextInput.flow.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,14 @@ export type Props = $ReadOnly<{|
560560
/**
561561
* Allows to adjust caret height.
562562
* The default value is 0, which means the height of the caret will be calculated automatically
563+
* @platform ios
563564
*/
564-
565565
caretYOffset?: ?number,
566+
566567
/**
567-
* Allows to adjust caret postiion relative to the Y axis
568+
* Allows to adjust caret position relative to the Y axis
568569
* The default value is 0.
570+
* @platform ios
569571
*/
570572
caretYHeight?: ?number,
571573

Libraries/Components/TextInput/TextInput.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,14 @@ type IOSProps = $ReadOnly<{|
371371
/**
372372
* Allows to adjust caret height.
373373
* The default value is 0, which means the height of the caret will be calculated automatically
374+
* @platform ios
374375
*/
375376
caretYOffset?: ?number,
376377

377378
/**
378-
* Allows to adjust caret postiion relative to the Y axis
379+
* Allows to adjust caret position relative to the Y axis
379380
* The default value is 0.
381+
* @platform ios
380382
*/
381383
caretHeight?: ?number,
382384
|}>;
@@ -1470,8 +1472,6 @@ function InternalTextInput(props: Props): React.Node {
14701472
selection={selection}
14711473
style={style}
14721474
text={text}
1473-
caretYOffset={props.caretYOffset}
1474-
caretHeight={props.caretHeight}
14751475
/>
14761476
);
14771477
} else if (Platform.OS === 'android') {

Libraries/Text/TextInput/Multiline/RCTUITextView.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,11 @@ - (CGRect)caretRectForPosition:(UITextPosition *)position
339339
originalRect.origin.y += _caretYOffset;
340340
}
341341

342-
if(_caretHeight != 0) {
342+
if(_caretHeight != 0) {
343343
originalRect.size.height = _caretHeight;
344344
}
345-
return originalRect;
345+
346+
return originalRect;
346347
}
347348

348349
- (NSArray *)selectionRectsForRange:(UITextRange *)range {

React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void RCTCopyBackedTextInput(
3939
toTextInput.spellCheckingType = fromTextInput.spellCheckingType;
4040
toTextInput.caretHidden = fromTextInput.caretHidden;
4141
toTextInput.caretYOffset = fromTextInput.caretYOffset;
42-
toTextInput.caretHeight = toTextInput.caretHeight;
42+
toTextInput.caretHeight = fromTextInput.caretHeight;
4343
toTextInput.clearButtonMode = fromTextInput.clearButtonMode;
4444
toTextInput.scrollEnabled = fromTextInput.scrollEnabled;
4545
toTextInput.secureTextEntry = fromTextInput.secureTextEntry;

ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ class TextInputTraits final {
160160
* iOS-only (inherently iOS-specific)
161161
* Default value: 0 with a default font.
162162
*/
163-
164163
int caretHeight{0};
165164

166165
/*

0 commit comments

Comments
 (0)