Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android app crashes while opening modal second time #290

Open
tusharkhatiwada opened this issue Nov 21, 2019 · 4 comments
Open

android app crashes while opening modal second time #290

tusharkhatiwada opened this issue Nov 21, 2019 · 4 comments

Comments

@tusharkhatiwada
Copy link

I have multiple markers loaded on the map. On pressing a marker a modal pops up with information. But when I try to open the modal next time the app crashes. It works on iOS though.
I have also tried this hack but it doesn't seem to work.
#248 (comment)

react-native: 0.61.1
react-native-modalbox: 2.0.0

@tusharkhatiwada
Copy link
Author

This simple change fixed my issue: #291

@leondenisjunior
Copy link

disable
backdropPressToClose={false}
swipeToClose={false}
and add button setting false

ex:
<Modal
isOpen={this.state.isOpenModalMesa}
onClosed={() => this.setState({ isOpenModaMesa: false })}
style={{height: 250, width: 250, borderRadius: 5}}
position={'center'}
coverScreen={true}
backdropPressToClose={false}
swipeToClose={false}
//backdropContent={BContent}
>
<TouchableOpacity onPress={()=> this.setState({isOpenModalMesa: false})}>
<Text style={{fontWeight: 'bold', color: '#cc0000'}}>Cancelar

@gertvdkolk
Copy link

I'm experiencing the same issue.
@tusharkhatiwada I tried your fix but it seems it is based on a particular scenario, for me it isn't working.

I'm using v2.0.0
React-native: 0.59 (expo SDK: 35)

@maxs15 on android the app crashes when a modal gets opened for the second time.
I open the modal when a press on a row in a table to show more detailed data inside the modal.
I configured the Modal component in a the following manner:

<Modal
  isOpen={this.props.orderId !== undefined}
  onOpened={this.openModal}   // side effect that dispatches an action
  onClosed={this.closeModal}  // performing a callback from the parent component.
  ... // some more props
/>

I can open and close the Modal 1 time, but the second time the app crashes without any error or other information.
With some debugger statements I could determine that the Animated.View from renderContent gets returned.

I was wondering if it might be the this.state.position that is passed to the translateY in the transform that is incorrect. I'm quite new to Animations though...

Any help would be appreciated!

@SolidTears
Copy link

hello everyone, if anyone stumbling upon this thread, and wondering a fix, i found my fix, not guaranteed will work for you just like other workaround, but worth to try, please refer here : my answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants