-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Focus() in Input! #74
Comments
Man, since it's an open library, I think you can try to sort and upload a pull request here in the project. To try to give you a help and believe that this is happening because of the "KeyboardAvoidingView", this component has a property called keyboardVerticalOffset that defines how much effect it will apply when the input is selected. Doc Official: https://facebook.github.io/react-native/docs/keyboardavoidingview |
@leommh maybe you can try using: https://reactjs.org/docs/forwarding-refs.html |
Another option, much like ref forwarding, but that would allow refs to either the galio input or the react-native textinput, would be to just add an
If that would be ok, I can open a PR. I've just changed it locally and it's working |
@sam1463 's solution is now included in v0.6 Thanks for your help! |
Hello, is there an example of how to get galio working with focus(). It doesn't seem to work for me, when i set onRef on the input i wish to focus on |
@initzx It should work to use it like this:
|
Thank you for explaining @sam1463 ! Just noticed the new Input misses that prop so it might not work. This needs to be updated asap so I'll reopen the issue. |
@palingheorghe oh yeah good catch! It looks like in this commit when that component was changed from a class component to a functional one, the |
You think you can push another PR for this issue? @sam1463 |
Yep, fixed it locally last night but haven't had time to open a PR yet. I should be able to when I get home later today. |
Thank you for your help! Looking forward to the PR! |
hey @sam1463 |
I already created one. For me, it's linked right above your comment, but in case that's not visible to you for some reason, it's here: #145 |
Hi @ammar-sheikh ! I'll push the PR to the master server as soon as possible, I'm just trying to collect more PRs because some developers already invested into a workaround for lots of bugs we had so any new version could break their apps. |
When the merge is expected? |
@gamingumar next week we'll clean the repo so we'll merge this PR as well because we're getting ready for v1.0. |
I try using like this but give me null is not an object Package.json (v.0.6.3) |
Closed because we've merged the PR into the |
Is your feature request related to a problem? Please describe.
The inputs do not pass the functions of focus (), blur (), among others of the TextInput of React Native.
Describe the solution you'd like
I would like these functions to be passed so that I could control focus and transfer from one input to another after I finish entering the value.
Describe alternatives you've considered
When the line:
ref = {input => (this.input = input)}
is added to the TextInput automatically the Input class wins the properties.
When creating the function:
function focusOnTextInput () {
return this.input.focus ()
};
It automatically causes the input to be focused, if it were to pass that function forward when the Input was imported, it was just to use it and the input would be focused.
But I tried to do this and the input does not show this function in its this, I do not know if it is because of the "withGalio" that is doing something, but the function does not come when using the input.
Additional context
Here is an example I could do by creating a customizable TextInput of mine!
The text was updated successfully, but these errors were encountered: