react-native-phone-input
react-native-phone-input copied to clipboard
[iOS] Close keyboard after entering phone number
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?
Maybe my pull request could fix this? https://github.com/thegamenicorus/react-native-phone-input/pull/66
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.")}
}}
/>
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
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