When i turn on the closeOnDragDown props, ScrollView stops working inside bottom sheet navigator.
This is my code.
To reproduce demo, can use https://github.com/nysamnang/react-native-raw-bottom-sheet/blob/master/example/static.json, data wich is shown came in json format.
`
import React from 'react'
import MapView, {Marker} from 'react-native-maps'
import {View, Alert, StyleSheet, Text, ScrollView} from 'react-native'
import RBSheet from 'react-native-raw-bottom-sheet'
class Mapa extends React.Component {
constructor(props) {
super(props)
this.state = {
region: {
latitude: -19.9203661, // 19.9203661 22.2087173
longitude: -43.9210439, // 43.9210439 54.8390909
latitudeDelta: 0.04, // 0.0922
longitudeDelta: 0.04, // 0.0421
},
pontosMarker: [],
pontos: [],
pontoSelecionado: [],
nomePonto: '',
}
}
markerDetails = async pontoNome => {
this.state.pontoSelecionado = []
Reactotron.log('pontoNome', pontoNome)
// Reactotron.log('pontoSelecionado INI', this.state.pontoSelecionado)
const pointAux = await this.state.pontos.filter(
res => res.nomePonto === pontoNome
)
Reactotron.log('pointAux', pointAux)
pointAux.map(res => {
this.setState({
pontoSelecionado: [...this.state.pontoSelecionado, res],
})
})
this.setState({nomePonto: pontoNome})
this.RBSheet.open()
}
render() {
return (
<View style={{flex: 1}}>
<MapView
style={{flex: 1}}
mapType='satellite'
initialRegion={this.state.region}
cacheEnabled={false}
region={this.state.region}>
{this.state.pontosMarker.map(item => {
return (
<Marker
key={item.id}
title={item.title}
description={item.description}
coordinate={item.coordinates}
onPress={() => {
this.markerDetails(item.nomePonto)
}}
/>
)
})}
<RBSheet
ref={ref => {
this.RBSheet = ref
}}
closeOnDragDown
customStyles={{
mask: {backgroundColor: 'transparent'},
container: {
elevation: 100,
height: 350,
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
backgroundColor: '#f7f5eee8',
},
draggableIcon: {
backgroundColor: '#00000040',
},
}}>
<ScrollView>
<View style={styles.messageContainerTitle}>
<Text style={styles.messageTitle}>{this.state.nomePonto}</Text>
</View>
<View>
{this.state.pontoSelecionado.map(res => {
const coords = JSON.parse(res.coordinates)
const date = this.formatDate(res.date)
if (res.fullInfo.tipoNC !== undefined) {
return (
<View key={res.date} style={styles.messageContainer}>
<View style={styles.message}>
<Text>
<Text style={{fontWeight: 'bold'}}>Fazenda:</Text>{' '}
{res.fazenda}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Talhão:</Text>{' '}
{res.field}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Data:</Text> {date}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Latitude:</Text>{' '}
{coords.lat}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Longitude:</Text>{' '}
{coords.lon}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Praga:</Text>{' '}
{res.pragueName}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>
Plantas analisadas:
</Text>{' '}
{res.plantasAtacadas}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>
Plantas atacadas:
</Text>{' '}
{res.plantasAnalisadas}
</Text>
</View>
<View style={styles.lineWithPlants} />
</View>
)
} else {
return (
<View key={res.date} style={styles.messageContainer}>
<View style={styles.message}>
<Text>
<Text style={{fontWeight: 'bold'}}>Fazenda:</Text>{' '}
{res.fazenda}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Talhão:</Text>{' '}
{res.field}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Data:</Text> {date}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Latitude:</Text>{' '}
{coords.lat}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Longitude:</Text>{' '}
{coords.lon}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Praga:</Text>{' '}
{res.pragueName}
</Text>
<Text>
<Text style={{fontWeight: 'bold'}}>Quantidade:</Text>{' '}
{res.quantity}
</Text>
</View>
<View style={styles.line} />
</View>
)
}
})}
</View>
</ScrollView>
</RBSheet>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
line: {
marginTop: 5,
borderBottomWidth: 1,
borderColor: '#000',
},
lineWithPlants: {
marginTop: 30,
borderBottomWidth: 1,
borderColor: '#000',
},
messageContainerTitle: {
paddingLeft: 20,
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
justifyContent: 'center',
flexDirection: 'row',
// backgroundColor: '#f7f5eee8',
backgroundColor: 'rgba(247, 245, 238, 0.1)',
},
messageTitle: {
fontSize: 22,
fontWeight: 'bold',
color: '#222',
},
messageContainer: {
flex: 1,
backgroundColor: '#fff',
},
message: {
height: 145,
paddingLeft: 20,
},
})
export default Mapa
`