Skip to content

Commit

Permalink
YellowBox" Only provide elevation style prop when running on Android
Browse files Browse the repository at this point in the history
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: #12223
Closes #12744

Differential Revision: D4684524

Pulled By: mkonicek

fbshipit-source-id: 7fb4f6da1c5c0cb437beff0e75122523e7233b72
  • Loading branch information
cailenmusselman authored and facebook-github-bot committed Mar 9, 2017
1 parent 921b9ac commit dd5ac84
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Libraries/ReactNative/YellowBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,22 @@ 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 might as well remove it altogether for iOS.
// See: https://github.com/facebook/react-native/issues/12223
const elevation = Platform.OS === 'android' ? Number.MAX_SAFE_INTEGER : undefined;

var styles = StyleSheet.create({
fullScreen: {
height: '100%',
elevation: Number.MAX_VALUE
elevation: elevation
},
inspector: {
backgroundColor: backgroundColor(0.95),
height: '100%',
paddingTop: 5,
elevation: Number.MAX_VALUE
elevation:elevation
},
inspectorButtons: {
flexDirection: 'row',
Expand Down Expand Up @@ -451,7 +457,7 @@ var styles = StyleSheet.create({
left: 0,
right: 0,
bottom: 0,
elevation: Number.MAX_VALUE
elevation: elevation
},
listRow: {
backgroundColor: backgroundColor(0.95),
Expand Down

0 comments on commit dd5ac84

Please sign in to comment.