mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00:00
7882506c75
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