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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -