Open wgltony opened 6 years ago
May you share your code it works for me.
Late to the party, but may help someone:
I had this problem, and order apparently counts.
The cancel argument needs to be the first, like this:
[
{ text: 'Cancel' },
{ text: 'OK', onPress: input => {} }
],
The following will not work under Android:
[
{ text: 'OK', onPress: input => {} }
{ text: 'Cancel' },
],
This is probably a bug, though.
@wgltony may you please edit the bug title per @edualm's explanation. Maybe title it "Order of options matters on Android".
@edualm you are correct order matters - https://github.com/shimohq/react-native-prompt-android/blob/master/index.android.js#L106
I updated the readme to reflect this.
The third argument can be the following:
()=>void | [ButtonPositive] | [ButtonNegative, ButtonPositive] | [ButtonNeutral, ButtonNegative, ButtonPositive],
Where ()=>void
is callback on press of "OK".
Can not get input text value.