From 1f3fd22b5e6ea6e3331893cebc54182004c0c8d0 Mon Sep 17 00:00:00 2001 From: OlimpiaZurek Date: Fri, 5 Apr 2024 13:05:32 +0200 Subject: [PATCH] changes after cr --- .../Text/TextInput/Multiline/RCTUITextView.mm | 10 +++++----- .../__tests__/__snapshots__/public-api-test.js.snap | 12 ------------ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm index 750898c6cebfc8..f752f722db5a3f 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm @@ -13,8 +13,8 @@ #import #import -//the UITextSelectionRect subclass needs to be created because the original version is not writable -@interface CustomTextSelectionRect : UITextSelectionRect +// subclass needs to be created as UITextSelectionRect is an abstract base class +@interface RCTTextSelectionRect : UITextSelectionRect @property (nonatomic, assign) CGRect rect; @property (nonatomic, assign) NSWritingDirection writingDirection; @@ -24,7 +24,7 @@ @interface CustomTextSelectionRect : UITextSelectionRect @end -@implementation CustomTextSelectionRect { +@implementation RCTTextSelectionRect { CGRect _customRect; NSWritingDirection _customWritingDirection; BOOL _customContainsStart; @@ -351,13 +351,13 @@ - (CGRect)caretRectForPosition:(UITextPosition *)position return originalRect; } -- (NSArray *)selectionRectsForRange:(UITextRange *)range { +- (NSArray *)selectionRectsForRange:(UITextRange *)range { NSArray *superRects = [super selectionRectsForRange:range]; if(_caretYOffset != 0 && _caretHeight != 0) { NSMutableArray *customTextSelectionRects = [NSMutableArray array]; for (UITextSelectionRect *rect in superRects) { - CustomTextSelectionRect *customTextRect = [[CustomTextSelectionRect alloc] init]; + RCTTextSelectionRect *customTextRect = [[RCTTextSelectionRect alloc] init]; customTextRect.rect = CGRectMake(rect.rect.origin.x, rect.rect.origin.y + _caretYOffset, rect.rect.size.width, _caretHeight); customTextRect.writingDirection = rect.writingDirection; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index de27ba219ed603..5fc6328813722a 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -2405,18 +2405,6 @@ declare export default HostComponent; " `; -exports[`public API should not change unintentionally Libraries/Components/TextInput/InputAccessoryView.js 1`] = ` -"type Props = $ReadOnly<{| - +children: React.Node, - nativeID?: ?string, - style?: ?ViewStyleProp, - backgroundColor?: ?ColorValue, -|}>; -declare const InputAccessoryView: React.AbstractComponent; -declare export default typeof InputAccessoryView; -" -`; - exports[`public API should not change unintentionally Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js 1`] = ` "export * from \\"../../../src/private/specs/components/RCTInputAccessoryViewNativeComponent\\"; declare export default typeof RCTInputAccessoryViewNativeComponent;