From f78ec778ce4d875e0c6a14ccc249b313a576e4be Mon Sep 17 00:00:00 2001 From: cailenmusselman Date: Thu, 9 Mar 2017 15:16:57 -0800 Subject: [PATCH] YellowBox" Only provide elevation style prop when running on Android Summary: For unknown reasons, setting elevation: Number.MAX_VALUE causes remote debugging to hang on iOS (some sort of overflow maybe). Setting it to Number.MAX_SAFE_INTEGER fixes the iOS issue, but since elevation is an android-only style property we might as well remove it altogether for iOS. See: https://github.com/facebook/react-native/issues/12223 Closes https://github.com/facebook/react-native/pull/12744 Differential Revision: D4684524 Pulled By: mkonicek fbshipit-source-id: 7fb4f6da1c5c0cb437beff0e75122523e7233b72 --- Libraries/ReactNative/YellowBox.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Libraries/ReactNative/YellowBox.js b/Libraries/ReactNative/YellowBox.js index d171da7267c..fb01f2e7c42 100644 --- a/Libraries/ReactNative/YellowBox.js +++ b/Libraries/ReactNative/YellowBox.js @@ -394,6 +394,13 @@ const textColor = 'white'; const rowGutter = 1; const rowHeight = 46; +// For unknown reasons, setting elevation: Number.MAX_VALUE causes remote debugging to +// hang on iOS (some sort of overflow maybe). Setting it to Number.MAX_SAFE_INTEGER fixes +// the iOS issue, but since elevation is an Android-only style property we should only +// use it on Android. +// See: https://github.com/facebook/react-native/issues/12223 +const elevation = Platform.OS === 'android' ? Number.MAX_SAFE_INTEGER : undefined; + var styles = StyleSheet.create({ fullScreen: { backgroundColor: 'transparent', @@ -402,13 +409,13 @@ var styles = StyleSheet.create({ right: 0, top: 0, bottom: 0, - elevation: Number.MAX_VALUE + elevation: elevation, }, inspector: { backgroundColor: backgroundColor(0.95), flex: 1, paddingTop: 5, - elevation: Number.MAX_VALUE + elevation: elevation, }, inspectorButtons: { flexDirection: 'row', @@ -456,7 +463,7 @@ var styles = StyleSheet.create({ left: 0, right: 0, bottom: 0, - elevation: Number.MAX_VALUE + elevation: elevation, }, listRow: { position: 'relative',