android - How to apply click event on TextInput in react native -
hi using textinput
in react native application. want open date dialog on clicking on textinput
. didn't find work around apply click event on textinput
. know how in react native ?
<textinput style={{ height: 40, bordercolor: "gray", borderwidth: 1, margintop: 8 }} underlinecolorandroid="transparent" placeholder={strings.schedule_date} onkeypress={keypress => console.log(keypress)} />
you can use onfocus
prop know when user has selected textinput
.
<textinput style={{ height: 40, bordercolor: "gray", borderwidth: 1, margintop: 8 }} underlinecolorandroid="transparent" placeholder={strings.schedule_date} onkeypress={keypress => console.log(keypress)} onfocus={() => yourcode()} />
unless have autofocus={true}
, work. can find more documentation onfocus
here:
https://facebook.github.io/react-native/docs/textinput.html#onfocus
Comments
Post a Comment