react-native-phone-input icon indicating copy to clipboard operation
react-native-phone-input copied to clipboard

[iOS] Close keyboard after entering phone number

Open maharjanaman opened this issue 6 years ago • 4 comments

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?

maharjanaman avatar Jun 19 '18 10:06 maharjanaman

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

vdlindenmark avatar Sep 03 '18 21:09 vdlindenmark

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.")}
    }}
/>

rajivnarayana avatar Oct 14 '18 07:10 rajivnarayana

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 avatar Aug 25 '23 21:08 softwarebyze

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

softwarebyze avatar Aug 25 '23 22:08 softwarebyze