Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native : Modal does not hide when Alert appears on top of it

I noticed a strange behavior that if Modal would present itself and then on top of it, if an Alert appears, the Alert disappears very soon without user clicking anything on it and the Modal, even if removed programmatically, doesn't remove from the screen. I consider is a bug. Is there a workaround?

like image 720
vaibhav chaturvedy Avatar asked Oct 14 '16 10:10

vaibhav chaturvedy


1 Answers

It seems to be a trouble in React Native. I've met this issue too. The easiest way to fix it is to call alert with timeout after modal is hidden: ... setTimeout(() => Alert.alert(msg), 10); ...

like image 78
Slowyn Avatar answered Sep 17 '22 13:09

Slowyn