thegamenicorus / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
394 stars 447 forks source link

[iOS] Close keyboard after entering phone number #51

Open maharjanaman opened 6 years ago

maharjanaman commented 6 years ago

Hy, is there a way to close keyboard after enter phone number on iOS platforms? I did tried to add returnKeyType props of react native textinput with its value done but had no luck. Can we show done button or something on keyboard while entering phone number?

vdlindenmark commented 6 years ago

Maybe my pull request could fix this? https://github.com/thegamenicorus/react-native-phone-input/pull/66

rajivnarayana commented 5 years ago

As a work around, might I suggest you to try setting textProps

<PhoneInput
    textProps={{
        returnKeyType: "next",
        keyboardType: "numbers-and-punctuation",
        onSubmitEditing: () => {console.log("May be focus next field.")}
    }}
/>
softwarebyze commented 1 year ago

I haven't tried it, but I think it's worth noting here that on iOS onSubmitEditing isn't called when using keyboardType="phone-pad" https://reactnative.dev/docs/textinput#onsubmitediting. I guess that's why @rajivnarayana changed the keyboard type in your answer

softwarebyze commented 1 year ago

Using enterKeyHint is working great for me! https://reactnative.dev/docs/textinput#enterkeyhint It let me add a "Done" button above the keyboard that works to dismiss that keyboard