sohobloo / react-native-modal-dropdown

A react-native dropdown/picker/selector component for both Android & iOS.
MIT License
1.19k stars 477 forks source link

How to use with Alert? #98

Open diegotsi opened 7 years ago

diegotsi commented 7 years ago

I'm trying to use this with alert from react native,when the user select a option i show a alert to confirm .

But after use Alert the modal dropdown never hide , it stays on the screen forever, no matter what screen I go. I'm showing the alert inside a function that a pass in onSelect prop.

Thanks.

Msspl-PrashenjeetRoy commented 7 years ago

I am also facing the same issue today.

sohobloo commented 6 years ago

Ir's a bug of react-native. You can delay the alert after the dropdown dismissed completely.

cihadturhan commented 6 years ago

I faced this issue too. Fadeout animation conflicts with Alert's fadein animation and it stuck in a strage state.

Although I don't like using timeouts in react-native, because it doesn't guarantee exact amount of timeout, adding setTimeout(()=> Alert.alert('...','...'), 100) will work as expected.