From 6faface1885b60db8bb56f3747fecd9731ab40f1 Mon Sep 17 00:00:00 2001 From: Pawel Sienkowski Date: Tue, 27 Oct 2015 09:20:48 -0700 Subject: [PATCH] RCTUIManager's setFrame:forView: fix - add support for Modal Reviewed By: javache Differential Revision: D2585415 fb-gh-sync-id: f367cf5353593363357dd86ec959acb1676cba9b --- React/Modules/RCTUIManager.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/React/Modules/RCTUIManager.m b/React/Modules/RCTUIManager.m index fe35779e2..bce65ca3b 100644 --- a/React/Modules/RCTUIManager.m +++ b/React/Modules/RCTUIManager.m @@ -348,9 +348,15 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls); { RCTAssertMainThread(); - // The following variables have no meaning if the view is not a react root view - RCTRootView *rootView = (RCTRootView *)[view superview]; - RCTRootViewSizeFlexibility sizeFlexibility = rootView != nil ? rootView.sizeFlexibility : RCTRootViewSizeFlexibilityNone; + // The following variable has no meaning if the view is not a react root view + RCTRootViewSizeFlexibility sizeFlexibility = RCTRootViewSizeFlexibilityNone; + + if (RCTIsReactRootView(view.reactTag)) { + RCTRootView *rootView = (RCTRootView *)[view superview]; + if (rootView != nil) { + sizeFlexibility = rootView.sizeFlexibility; + } + } NSNumber *reactTag = view.reactTag; dispatch_async(_shadowQueue, ^{