|
24 | 24 | #import "RCTLog.h" |
25 | 25 | #import "RCTProfile.h" |
26 | 26 | #import "RCTRootView.h" |
| 27 | +#import "RCTRootViewInternal.h" |
27 | 28 | #import "RCTScrollableProtocol.h" |
28 | 29 | #import "RCTShadowView.h" |
29 | 30 | #import "RCTSparseArray.h" |
@@ -357,10 +358,6 @@ - (void)setFrame:(CGRect)frame forView:(UIView *)view |
357 | 358 | RCTAssert(rootShadowView != nil, @"Could not locate root view with tag #%@", reactTag); |
358 | 359 |
|
359 | 360 | if (RCTIsReactRootView(reactTag)) { |
360 | | - if (CGRectEqualToRect(frame, rootShadowView.frame) && rootShadowView.sizeFlexibility == sizeFlexibility) { |
361 | | - // This is to prevent infinite recursion when the frame update is trigerred by TODO(8608567):<DelegateName> |
362 | | - return; |
363 | | - } |
364 | 361 | rootShadowView.frame = frame; |
365 | 362 | rootShadowView.sizeFlexibility = sizeFlexibility; |
366 | 363 | } else { |
@@ -491,6 +488,22 @@ - (RCTViewManagerUIBlock)uiBlockWithLayoutUpdateForRootView:(RCTShadowView *)roo |
491 | 488 | }, |
492 | 489 | }); |
493 | 490 | } |
| 491 | + |
| 492 | + if (RCTIsReactRootView(shadowView.reactTag)) { |
| 493 | + NSNumber *reactTag = shadowView.reactTag; |
| 494 | + CGSize contentSize = shadowView.frame.size; |
| 495 | + |
| 496 | + dispatch_async(dispatch_get_main_queue(), ^{ |
| 497 | + UIView *view = _viewRegistry[reactTag]; |
| 498 | + RCTAssert(view != nil, @"view (for ID %@) not found", reactTag); |
| 499 | + |
| 500 | + RCTRootView *rootView = (RCTRootView *)[view superview]; |
| 501 | + RCTAssert(rootView != nil, @"View with react tag %@ has not a superview", reactTag); |
| 502 | + |
| 503 | + rootView.intrinsicSize = contentSize; |
| 504 | + }); |
| 505 | + } |
| 506 | + |
494 | 507 | if (block) { |
495 | 508 | [updateBlocks addObject:block]; |
496 | 509 | } |
|
0 commit comments