Is your feature request related to a problem? Please describe.
I have a form with several fields, a couple text inputs followed by a picker. I'd like to use the 'Next' button on the iOS/Android keyboard to programmatically focus the picker.
Describe the solution you'd like
A method that programmatically focuses the picker.
It's apparently undocumented, but have you tried togglePicker()?
@sidraval does togglePicker solve your needs on iOS?
For Android, this issue exists on the feature req board as #22
@sidraval let me know if that solves it so i can close this out
@lfkwtz My project wrapped up, so I can't test togglePicker() anymore – I'll close this out now
Just to confirm, yes this.refs['picker'].togglePicker() worked.
Just to confirm, yes
this.refs['picker'].togglePicker()worked.
Calling togglePicker outside of the component does not seem to work for me:
this.select.current.togglePicker();
<RNPickerSelect
ref={this.select}
onValueChange={fn}
items={[]}
/>
Just to confirm, yes
this.refs['picker'].togglePicker()worked.Calling
togglePickeroutside of the component does not seem to work for me:this.select.current.togglePicker(); <RNPickerSelect ref={this.select} onValueChange={fn} items={[]} />
This seems to work on iOS but not android.
see link above ^ #22
Outside of the component calling open works for me
class InputSelect {
private picker;
render() {
return (
<RNPickerSelect ref={e => this.picker = e} ... />
)
}
open() { this.picker.togglePicker() }
}
Most helpful comment
This seems to work on iOS but not android.