@@ -78,7 +78,6 @@ - (RCTShadowView *)shadowView
7878
7979- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary <NSNumber *, RCTShadowView *> *)shadowViewRegistry
8080{
81- NSMutableSet *textViewTagsToUpdate = [NSMutableSet new ];
8281 for (RCTShadowView *rootView in shadowViewRegistry.allValues ) {
8382 if (![rootView isReactRootView ]) {
8483 // This isn't a root view
@@ -103,19 +102,6 @@ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNu
103102 RCTLogError (@" Raw text cannot be used outside of a <Text> tag. Not rendering string: '%@ '" ,
104103 [(RCTShadowRawText *)shadowView text ]);
105104 } else {
106- NSNumber *reactTag = shadowView.reactTag ;
107- // This isn't pretty, but hopefully it's temporary
108- // the problem is, there's no easy way (besides the viewName)
109- // to tell from the shadowView if the view is an RKTextView
110- if ([shadowView.viewName hasSuffix: @" TextView" ]) {
111- // Add to textViewTagsToUpdate only if has a RCTShadowText subview
112- for (RCTShadowView *subview in shadowView.reactSubviews ) {
113- if ([subview isKindOfClass: [RCTShadowText class ]]) {
114- [textViewTagsToUpdate addObject: reactTag];
115- break ;
116- }
117- }
118- }
119105 for (RCTShadowView *child in [shadowView reactSubviews ]) {
120106 if ([child isTextDirty ]) {
121107 [queue addObject: child];
@@ -127,52 +113,7 @@ - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(NSDictionary<NSNu
127113 }
128114 }
129115
130- /* *
131- * NOTE: this logic is included to support rich text editing inside multiline
132- * `<TextInput>` controls. It is required in order to ensure that the
133- * textStorage (aka attributed string) is copied over from the RCTShadowText
134- * to the RCTText view in time to be used to update the editable text content.
135- */
136- if (textViewTagsToUpdate.count ) {
137-
138- NSMutableArray <RCTViewManagerUIBlock> *uiBlocks = [NSMutableArray new ];
139- for (NSNumber *reactTag in textViewTagsToUpdate) {
140- RCTShadowView *shadowTextView = shadowViewRegistry[reactTag];
141- RCTShadowText *shadowText;
142- for (RCTShadowText *subview in shadowTextView.reactSubviews ) {
143- if ([subview isKindOfClass: [RCTShadowText class ]]) {
144- shadowText = subview;
145- break ;
146- }
147- }
148-
149- UIEdgeInsets padding = shadowText.paddingAsInsets ;
150- CGFloat width = shadowText.frame .size .width - (padding.left + padding.right );
151-
152- NSTextStorage *textStorage = [shadowText buildTextStorageForWidth: width widthMode: CSS_MEASURE_MODE_EXACTLY];
153- [uiBlocks addObject: ^(RCTUIManager *uiManager, NSDictionary <NSNumber *, RCTTextView *> *viewRegistry) {
154- RCTTextView *textView = viewRegistry[reactTag];
155- RCTText *text;
156- for (RCTText *subview in textView.reactSubviews ) {
157- if ([subview isKindOfClass: [RCTText class ]]) {
158- text = subview;
159- break ;
160- }
161- }
162-
163- text.textStorage = textStorage;
164- [textView performTextUpdate ];
165- }];
166- }
167-
168- return ^(RCTUIManager *uiManager, NSDictionary <NSNumber *, UIView *> *viewRegistry) {
169- for (RCTViewManagerUIBlock uiBlock in uiBlocks) {
170- uiBlock (uiManager, viewRegistry);
171- }
172- };
173- } else {
174- return nil ;
175- }
116+ return nil ;
176117}
177118
178119- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView : (RCTShadowText *)shadowView
0 commit comments