Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto focus #25

Closed
kyangy opened this issue Aug 23, 2017 · 5 comments
Closed

Auto focus #25

kyangy opened this issue Aug 23, 2017 · 5 comments
Labels

Comments

@kyangy
Copy link

kyangy commented Aug 23, 2017

Hi, is there a way to auto focus the search input on render?

@jacobbodkin
Copy link
Contributor

@kyangy I added a pull request for this feature. Until then you can use my fork at https://github.com/jacobbodkin/react-native-search-box.git

@anhtuank7c
Copy link
Contributor

anhtuank7c commented Aug 29, 2017

@kyangy Actually you can do it via component ref because i already added input_keyword to the input.

In example:

<SearchBox ref={ref => this.searchRef = ref} />

Then you can do focus anywhere in the component

do console.log(this.searchRef);  //for sure
this.searchRef.refs.input_keyword  // something like this

@jacobbodkin Thank you. I am not decided to merge or not. Will review it later

@kyangy
Copy link
Author

kyangy commented Aug 29, 2017

@jacobbodkin @anhtuank7c thanks yea i just ended up using ref good call!

@anhtuank7c
Copy link
Contributor

@kyangy Can we closing this?

@progamr
Copy link

progamr commented Sep 20, 2017

@anhtuank7c why don't you merged the contribution of @jacobbodkin it is more declarative i couldn't apply your solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants