ScrollView inside MaterialDialog doesn't scroll
Code snippet:
<MaterialDialog
visible={this.state.isVisible}
okLabel={'OK'}
onOk={this.closeModal}
onCancel={this.closeModal}
scrolled={true}
>
<ScrollView>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
</ScrollView>
</MaterialDialog>
The View containing the children should set onStartShouldSetResponder , as detailed in this SO:
https://stackoverflow.com/questions/33060859/react-native-touchable-is-disabling-scrollview
Tested the fix and it works well. I'll submit a PR.
An alternative solution which doesn't require changes to this library is to wrap the children within the ScrollView. The View is given the prop onStartShouldSetResponder which tells it to pass up the touch-start event to the ScrollView.
It may be helpful to document this in the Readme.
<MaterialDialog
visible={this.state.isVisible}
okLabel={'OK'}
onOk={this.closeModal}
onCancel={this.closeModal}
scrolled={true}
>
<ScrollView>
<View onStartShouldSetResponder={() => true}>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
<Text style={{padding: 100}}>Lorem ipsum ....</Text>
</View>
</ScrollView>
</MaterialDialog>

this Line be changed const { height } = Platform.OS == 'android' ? Dimensions.get('window') : Dimensions.get('screen');