Please check #483
I'm having this same issue actually, does not seem to be fixed. The onChange from #483 is working fine but if I try to ref the <Input ref='foo' /> using this.refs.foo._root it return undefined when floatingLabel is set as a prop on <Item />.
Works:
<Item>
<Label>Foo</Label>
<Input ref='bar' />
</Item>
console.log(this.refs.bar._root)
// returns Object()
Doesn't work:
<Item floatingLabel>
<Label>Foo</Label>
<Input ref='bar' />
</Item>
console.log(this.refs.bar._root)
// return undefined
Basically I need this so I can set focus on the next Input ( ie. this.refs.foo._root.focus() )
Please check this
I'm having the same issue as @carlosl on [email protected].
Did you check the above link and try out the solution?
The last comments in that link was about someone having trouble with an Input in an Item without floatingLabel, and that seems to work.
The problem is that when I add floatingLabel to the item, the Input's ref stops working.
cc @shivrajkumar
Try getRef instead of ref.
The usual ref doesn't work for floatingLabel.
I have the same problem, fix please
@shivrajkumar how to use getRef can you please give an example for floatingLabel
cc @sankhadeeproy007
It was a headache but finally found the solution.
cc @shivrajkumar @sankhadeeproy007
```export default class SignUpForm extends Component {
_focusInput(inputField) {
this[inputField]._root.focus();
}
render() {
return (
@naman03malhotra's solution verified working.
Was losing my mind trying to find the solution...thanks!
react-native-cli: 2.0.1
react-native: 0.49.5
react: 16.0.0-beta.5
native-base: 2.3.3
EDIT: Seems like it works on iOS and not Android.
proposed solution doesn't work for android.
Most helpful comment
It was a headache but finally found the solution.
cc @shivrajkumar @sankhadeeproy007
```export default class SignUpForm extends Component {
_focusInput(inputField) {
this[inputField]._root.focus();
}
render() {
return (