react-native-prompt-android icon indicating copy to clipboard operation
react-native-prompt-android copied to clipboard

Android not work

Open wgltony opened this issue 8 years ago • 4 comments

Can not get input text value.

wgltony avatar Jan 12 '18 02:01 wgltony

May you share your code it works for me.

Noitidart avatar Jan 15 '18 14:01 Noitidart

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.

edualm avatar Jan 22 '18 15:01 edualm

@wgltony may you please edit the bug title per @edualm's explanation. Maybe title it "Order of options matters on Android".

Noitidart avatar Mar 10 '18 00:03 Noitidart

@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".

Noitidart avatar Mar 13 '18 17:03 Noitidart