diff --git a/packages/components/src/sandbox/index.native.js b/packages/components/src/sandbox/index.native.js index 844997779e3e6a..df5f0138fb95f8 100644 --- a/packages/components/src/sandbox/index.native.js +++ b/packages/components/src/sandbox/index.native.js @@ -1,13 +1,14 @@ /** * External dependencies */ -import { Dimensions, Platform } from 'react-native'; +import { Dimensions, StyleSheet } from 'react-native'; import { WebView } from 'react-native-webview'; /** * WordPress dependencies */ import { + Platform, renderToString, memo, useRef, @@ -307,6 +308,7 @@ function Sandbox( { style={ [ sandboxStyles[ 'sandbox-webview__content' ], getSizeStyle(), + Platform.isAndroid && workaroundStyles.webView, ] } onMessage={ checkMessageForResize } scrollEnabled={ false } @@ -317,4 +319,15 @@ function Sandbox( { ); } +const workaroundStyles = StyleSheet.create( { + webView: { + /** + * The slight opacity below is a workaround for an Android crash caused from combining Android + * 12's new scroll overflow behavior and webviews. + * https://github.com/react-native-webview/react-native-webview/issues/1915#issuecomment-808869253 + */ + opacity: 0.99, + }, +} ); + export default memo( Sandbox ); diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index bb401e0ec9984a..11d2ed3a45c172 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -13,6 +13,7 @@ For each user feature we should also add a importance categorization label to i - [*] Add React Native FastImage [#42009] - [*] Block inserter displays block collections [#42405] +- [**] Fix a crash when scrolling posts containing Embed blocks (Android 12 only) [#42514] ## 1.79.0 - [*] Add 'Insert from URL' option to Video block [#41493]