react-native-modalbox
react-native-modalbox copied to clipboard
Open modal performance is slow for Android
Just using the following code for item selection feature. Now i am using doc provided method to open modal. The modal will be shown after 2 seconds which makes UX bad. Any suggestion ? Thanks a lot !
<Modal
duration={0}
style={styles.jumpPageModal}
ref="jumpPageModal"
swipeToClose={false}
swipeArea={0}
onClosed={this._reactiveSwipeBack.bind()}
>
<ScrollView
contentContainerCustomStyle={styles.jumpPageModalScrollView}
ref="jumpPageScrollView"
showsVerticalScrollIndicator={false}
>
<View style={styles.jumpPageModalContainer}>
{this.state.jumpPageOption.map((x, i) => {
if (this.state.currentPage != i)
return (<TouchableOpacity key={i} style={styles.jumpPageOption}><Text>Page {i + 1}</Text></TouchableOpacity>)
return (<TouchableOpacity onLayout={this._getCurrentPageOptionOffset.bind(this)} key={i} style={styles.jumpPageOption}><Text style={styles.jumpPageOptionSelected}>Page {i + 1}</Text></TouchableOpacity>)
})}
</View>
</ScrollView>
</Modal>
You can stop Remote JS Debug for test
Even i have the same issue, modal opens after some time and it is very jerky. Any solution to avoid that?
@stockcode stop js debug doesn't help. i experience the same result :(
Same on Nexus 5x in Android simulator. Opening a modal is really slow.
I am experiencing similar issues, which is rendering this component useless for most Android devices. I can't even get it to open back up if I click in the time it is trying to open (3-5 seconds).
+1, slow when chrome developer tools is open
Even without the debugger it's lagging on Android.
+1
+1
+1
Any solution for this issue?
Even Without Debugger Modal Opens very slow . Please Let me know the Error
<Modal transparent={true} visible={this.state.modalVisible} onRequestClose={() => { Alert.alert('Modal has been closed.'); }}> <View style={{flex:1,backgroundColor:'rgba(0,0,0,0.4)'}}> <View style={{elevation:5,position:'absolute',height:200,width:150,left:'30%',right:'30%',top:'55%',backgroundColor:'white'}}> <Text style={{flex:1,fontFamily:"Montserrat-Bold",alignSelf:'center'}}> MENU </Text> <Menu/> <TouchableHighlight style={{flex:1,height:20,margin:5,elevation:2,borderRadius:20,backgroundColor:'grey'}} onPress={() => this.setModalVisible(!this.state.modalVisible)}> <Text style={{flex:1,color:'white',fontSize:14, fontFamily:'Montserrat-Bold', alignSelf:'center', textAlignVertical:'center'}}> CLOSE </Text> </TouchableHighlight> </View> </View> </Modal>
Any solution for this issue?
+1
I always find this Modal pretty slow on Android , specially if there is more transparent background area , more it goes slow.
still facing same issue
I am also facing the same it is taking 5-10 seconds to close the model.
I am also facing the same issue , in IOS it work perfect but in Android it take time to toggle modal
same here
You can stop Remote JS Debug for test
its saved my day, thank you.
Same issue in 2020
Same issue in 2021
Same issue in 2022!
Same issue in mid-2022