react-native/React/Views
PJ Cabrera 7882506c75 Send the evaluation of the injectedJavaScript prop back to the React Native side
Summary: We have a use case in the development of our app, where we are rendering some HTML content in a web view. But this content comes from the back end, and varies in height. There are other components on the page, so it's not a full screen web view. We need to dynamically alter the web view height, to fit the HTML content without scrolling, and to push the non-web view content on the screen down.

The solution I came up with, was to use the _loadingFinish callback, to send the evaluation of the injectedJavaScript property back to the React Native side. In my example above, injecting 'document.getElement(elementId).offsetHeight' evaluates to the height of the element, with margins and borders applied, and once returned to the RN app, it can change the app state and cause the web view height to be adjusted.
Closes https://github.com/facebook/react-native/pull/2753

Reviewed By: svcscm

Differential Revision: D2578688

Pulled By: mkonicek

fb-gh-sync-id: fc9c0d0f84994a409e037016a555534549f8957a
2015-10-23 20:24:26 -07:00
..
RCTActivityIndicatorViewManager.h Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
RCTActivityIndicatorViewManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTAnimationType.h [LayoutAnimation] RCTAnimationTypeKeyboard 2015-06-25 09:17:01 -08:00
RCTAutoInsetsProtocol.h Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
RCTBorderDrawing.h Implemented fast path for same borders/radii 2015-05-28 09:16:44 -08:00
RCTBorderDrawing.m Implemented fast path for same borders/radii 2015-05-28 09:16:44 -08:00
RCTComponent.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTComponentData.h [rn] Pass props when creating a view in RCTViewManager 2015-08-25 08:08:17 -08:00
RCTComponentData.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTConvert+CoreLocation.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+CoreLocation.m [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.h [MapView] Support for annotation callouts, annotation press, callout presses and pin animation 2015-06-25 09:15:21 -08:00
RCTConvert+MapKit.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTDatePicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTDatePickerManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTDatePickerManager.m Fixed DatePickerIOS onChange event 2015-09-10 10:10:26 -07:00
RCTImageComponent.h Implemented inline image support for <Text> 2015-10-08 11:56:25 -07:00
RCTMap.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTMap.m Fixed ActivityIndicatorIOS layout 2015-10-23 09:13:24 -07:00
RCTMapManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTMapManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTModalHostView.h Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTModalHostView.m Only dismiss <Modal> once 2015-10-06 10:29:27 -07:00
RCTModalHostViewController.h Add <Modal /> component 2015-07-28 07:21:50 -08:00
RCTModalHostViewController.m Prevent setFrame:forView: being called for invalidated views 2015-09-18 17:33:25 -07:00
RCTModalHostViewManager.h Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTModalHostViewManager.m Enable transparent modal presentation with <Modal /> 2015-08-14 04:47:12 -08:00
RCTNavItem.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavItem.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavItemManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTNavItemManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTNavigator.h Remove isValid from RCTInvalidating 2015-08-14 01:57:18 -08:00
RCTNavigator.m Add controller to closest parent on time so as to fix the automaticallyAdjustContentInsets feature. 2015-10-23 03:15:25 -07:00
RCTNavigatorManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTNavigatorManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPicker.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPicker.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTPickerManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTPickerManager.m Fixed PickerIOS onChange event 2015-09-08 03:34:33 -08:00
RCTPointerEvents.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTProgressViewManager.h Added ProgressViewIOS 2015-06-03 09:49:35 -08:00
RCTProgressViewManager.m Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
RCTScrollView.h Definable distance pagination for ScrollView 2015-09-23 11:47:25 -07:00
RCTScrollView.m reduce leeway to 1, child clipping updated every scroll movement. This fixes scroll view behaviour 2015-09-25 10:24:02 -07:00
RCTScrollViewManager.h Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
RCTScrollViewManager.m Definable distance pagination for ScrollView 2015-09-23 11:47:25 -07:00
RCTScrollableProtocol.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSegmentedControl.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSegmentedControl.m Fixed segmented control 2015-09-10 04:50:24 -07:00
RCTSegmentedControlManager.h Add SegmentedControlIOS 2015-04-29 08:08:45 -08:00
RCTSegmentedControlManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTShadowView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTShadowView.m pull in github css-layout into fbobjc react native 2015-09-20 20:35:29 -07:00
RCTSlider.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSlider.m [SliderIOS] Apply value after minimum/maximumValue in order to ensure it is properly set 2015-04-21 11:09:10 -08:00
RCTSliderManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSliderManager.m End slider interaction when touches are cancelled 2015-09-25 11:42:32 -07:00
RCTSwitch.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTSwitch.m [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTSwitchManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBar.m Add controller to closest parent on time so as to fix the automaticallyAdjustContentInsets feature. 2015-10-23 03:15:25 -07:00
RCTTabBarItem.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBarItem.m Allow nil tabbar item icon 2015-10-06 10:29:01 -07:00
RCTTabBarItemManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarItemManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTabBarManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTTabBarManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTTextDecorationLineType.h <Text> module add textDecoration style attributes 2015-07-07 06:15:20 -08:00
RCTView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTView.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTViewControllerProtocol.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTViewManager.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTViewManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWebView.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWebView.m Send the evaluation of the injectedJavaScript prop back to the React Native side 2015-10-23 20:24:26 -07:00
RCTWebViewManager.h [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
RCTWebViewManager.m Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.h Added mechanism for directly mapping JS event handlers to blocks 2015-09-02 06:11:24 -08:00
RCTWrapperViewController.m Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -08:00
UIView+Private.h Perform clip update on RCTScrollView in increments of 50 pt 2015-08-13 07:56:41 -08:00
UIView+React.h Refactor RCTUIManager 2015-08-06 15:49:35 -08:00
UIView+React.m Fixed ActivityIndicatorIOS layout 2015-10-23 09:13:24 -07:00