react-native-modalbox icon indicating copy to clipboard operation
react-native-modalbox copied to clipboard

Open modal performance is slow for Android

Open tikkichan4 opened this issue 6 years ago • 24 comments

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>

tikkichan4 avatar Jul 06 '17 05:07 tikkichan4

You can stop Remote JS Debug for test

stockcode avatar Jul 12 '17 03:07 stockcode

Even i have the same issue, modal opens after some time and it is very jerky. Any solution to avoid that?

Thanmai-C avatar Aug 15 '17 15:08 Thanmai-C

@stockcode stop js debug doesn't help. i experience the same result :(

dzpt avatar Aug 23 '17 19:08 dzpt

Same on Nexus 5x in Android simulator. Opening a modal is really slow.

ghost avatar Sep 07 '17 03:09 ghost

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).

arinhouck avatar Oct 13 '17 03:10 arinhouck

+1, slow when chrome developer tools is open

ghost avatar Nov 04 '17 07:11 ghost

Even without the debugger it's lagging on Android.

Sebastian-Neubert avatar Jan 28 '18 11:01 Sebastian-Neubert

+1

gusilveiramp avatar Feb 18 '18 06:02 gusilveiramp

+1

AFMW avatar Jul 05 '18 21:07 AFMW

+1

msnajib avatar Sep 22 '18 19:09 msnajib

Any solution for this issue?

ManigandanRaamanathan avatar Nov 09 '18 08:11 ManigandanRaamanathan

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>

rishabhrathod01 avatar Nov 13 '18 10:11 rishabhrathod01

Any solution for this issue?

hansfpc avatar Sep 09 '19 15:09 hansfpc

+1

ezranbayantemur avatar Sep 25 '19 13:09 ezranbayantemur

I always find this Modal pretty slow on Android , specially if there is more transparent background area , more it goes slow.

amitbravo avatar Oct 07 '19 03:10 amitbravo

still facing same issue

waqaramjad avatar Dec 17 '19 09:12 waqaramjad

I am also facing the same it is taking 5-10 seconds to close the model.

ramanasak avatar Jan 17 '20 09:01 ramanasak

I am also facing the same issue , in IOS it work perfect but in Android it take time to toggle modal

komelabbbas avatar Jan 20 '20 11:01 komelabbbas

same here

ChinmayDeyUI avatar Jan 20 '20 11:01 ChinmayDeyUI

You can stop Remote JS Debug for test

its saved my day, thank you.

ranggabadrus avatar Jan 23 '20 04:01 ranggabadrus

Same issue in 2020

ghost avatar Apr 08 '20 12:04 ghost

Same issue in 2021

s-hliao avatar May 11 '21 17:05 s-hliao

Same issue in 2022!

dvijeniii05 avatar Jan 03 '22 15:01 dvijeniii05

Same issue in mid-2022

JackBlakeston avatar Jun 30 '22 23:06 JackBlakeston