fix BottomSheet shaking
This commit is contained in:
parent
99de9d0bfa
commit
245eb89b85
|
@ -61,11 +61,7 @@ class BottomSheet extends PureComponent<Props> {
|
||||||
styles.sheetItemContainer,
|
styles.sheetItemContainer,
|
||||||
_styles.sheet
|
_styles.sheet
|
||||||
] }>
|
] }>
|
||||||
<ScrollView
|
{ this._getWrappedContent() }
|
||||||
bounces = { false }
|
|
||||||
showsVerticalScrollIndicator = { false }>
|
|
||||||
{ this._getWrappedContent() }
|
|
||||||
</ScrollView>
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</SlidingView>
|
</SlidingView>
|
||||||
|
@ -73,24 +69,32 @@ class BottomSheet extends PureComponent<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps the content when needed (iOS 11 and above), or just returns the original children.
|
* Wraps the content when needed (iOS 11 and above), or just returns the original content.
|
||||||
*
|
*
|
||||||
* @returns {React$Element}
|
* @returns {React$Element}
|
||||||
*/
|
*/
|
||||||
_getWrappedContent() {
|
_getWrappedContent() {
|
||||||
|
const content = (
|
||||||
|
<ScrollView
|
||||||
|
bounces = { false }
|
||||||
|
showsVerticalScrollIndicator = { false } >
|
||||||
|
{ this.props.children }
|
||||||
|
</ScrollView>
|
||||||
|
);
|
||||||
|
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
const majorVersionIOS = parseInt(Platform.Version, 10);
|
const majorVersionIOS = parseInt(Platform.Version, 10);
|
||||||
|
|
||||||
if (majorVersionIOS > 10) {
|
if (majorVersionIOS > 10) {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
{ this.props.children }
|
{ content }
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.props.children;
|
return content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue