React-native: Question: how show 'next' button in number-pad TextInput

Created on 16 Oct 2019  Â·  14Comments  Â·  Source: facebook/react-native

I have a form with some TextInputs, someone of the are number-pad.
How can I show next button with number-pad keyboard?

DONE button works fine.

<TextInput keyboardType="number-pad" returnKeyType={ 'done' } />

image

NEXT button is not visible.

<TextInput keyboardType="number-pad" returnKeyType={ 'next' } />

image

Button TextInput Ran Commands Question

Most helpful comment

Why this is closed? Still a problem too me too in 0.61.5

All 14 comments


We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

👉 Click here if you want to report a reproducible bug or regression in React Native.

+1

Anyone find a solution to this?

(Platform.OS === 'ios') ? 'done' : 'next' — good spike 🥇

This still happens in 0.61.2 Is there a iOS reason for the "Next" not to appear?

Any updates on this?

(Platform.OS === 'ios') ? 'done' : 'next' — good spike 🥇

If you use formik, done as returnKeyType dispatch handleSubmit so done is not an option.

Why this is closed? Still a problem too me too in 0.61.5

any solution for this? having this issue.. but closed?

Same problem here. Any solution??

Simply add an InputAccessoryView and bind the next input focus event to a button inside that view

Simply add an InputAccessoryView and bind the next input focus event to a button inside that view

I am curious about this approach, could you share a code block example? Thanks

(Platform.OS === 'ios') ? 'done' : 'next' — good spike 🥇

If you use formik, done as returnKeyType dispatch handleSubmit so done is not an option.

Thats odd, I am trying to solve this and I am using Formik, had to create a whole class component just to hold my forms to be able to focus the next input as useRef was not working for me, and calling returnKeyType="done" in IOS goes to the next field for me, instead of submitting. I had to explicit set the last input to submit with onSubmitEditing={() => handleSubmit()}

<FormInput
  allowFontScaling={false}
  onChangeText={handleChange('redemptionsTotal')}
  onBlur={handleBlur('redemptionsTotal')}
  name="redemptionsTotal"
  value={values.redemptionsTotal}
  error={errors.redemptionsTotal}
  touched={touched.redemptionsTotal}
  placeholder="TOTAL"
  returnKeyType={Platform.OS === 'ios' ? 'done' : 'next'}
  blurOnSubmit={false}
  keyboardType="numeric"
  setInpRef={(inpRedeemTotal) => (this.inpRedeemTotal = inpRedeemTotal)}
  onSubmitEditing={() => this.inpRedeemUser.focus()}
  style={styles.inputShort}
/>;

I have a form with some TextInputs, someone of the are number-pad.
How can I show next button with number-pad keyboard?

DONE button works fine.

<TextInput keyboardType="number-pad" returnKeyType={ 'done' } />

image

NEXT button is not visible.

<TextInput keyboardType="number-pad" returnKeyType={ 'next' } />

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TrakBit picture TrakBit  Â·  3Comments

aniss picture aniss  Â·  3Comments

josev55 picture josev55  Â·  3Comments

oney picture oney  Â·  3Comments

anchetaWern picture anchetaWern  Â·  3Comments