Nativebase: Native Base: How to select the next TextInput after pressing the “next” keyboard button?

Created on 8 Dec 2017  ·  4Comments  ·  Source: GeekyAnts/NativeBase

Hello,

How to select the next TextInput after pressing the “next” keyboard button?i tried with below code but it's not working, please help,

//Funcation
_focusNextField(nextField) {
this.refs[nextField].focus()
}

// UI

onSubmitEditing={() => this._focusNextField('agencyNo')}
returnKeyType = {"next"}
ref="agencyName"
blurOnSubmit={false}
onChangeText={agencyName => this.setState({agencyName: agencyName})}
style={{ height: 40 }} />


value={this.state.agencyFEIN}
ref="agencyNo"
onChangeText={agencyNo=> this.setState({agencyNo: agencyNo})}
style={{ height: 40 }} />

awaiting response

Most helpful comment

@ap050492 replace

this.refs[nextField].focus()

by

this.refs[nextField]._root.focus()

All 4 comments

@ap050492 replace

this.refs[nextField].focus()

by

this.refs[nextField]._root.focus()

Thanks, but now working...
when i print refs in console {console.log(this.refs)} it's showing like below
{}
__proto__
:
constructor
:
ƒ Object()
hasOwnProperty
:
ƒ hasOwnProperty()
isPrototypeOf
:
ƒ isPrototypeOf()
propertyIsEnumerable
:
ƒ propertyIsEnumerable()
toLocaleString
:
ƒ toLocaleString()
toString
:
ƒ toString()
valueOf
:
ƒ valueOf()
__defineGetter__
:
ƒ __defineGetter__()
__defineSetter__
:
ƒ __defineSetter__()
__lookupGetter__
:
ƒ __lookupGetter__()
__lookupSetter__
:
ƒ __lookupSetter__()
get __proto__
:
ƒ __proto__()
set __proto__
:
ƒ __proto__()

Closing this issue due to no response

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cotel picture Cotel  ·  3Comments

Bundas picture Bundas  ·  3Comments

sihemhssine picture sihemhssine  ·  3Comments

natashache picture natashache  ·  3Comments

kitsune7 picture kitsune7  ·  3Comments