skip to Main Content

enter image description hereIn IOS there is a top bar over the keyboard sometimes eg. When the input is focused and the type of input is "tel", it would allow you to paste the phone number with one click or if there is something in sms message. I need to disable it on just one screen. How can I do this? My problem is that on this screen I have a set of inputs for a single code number with max length 1 and when I try to intercept this on press I get only one digit consoled so I cannot do anything with it. Perhaps there is an event of sorts that would allow me to read the full input even with the length limitation set on the input? Or if not that I would need to hide it. I use react-native-avoid-softinput to handle avoiding keyboard if that makes any difference.

Thanks

2

Answers


  1. You can use the KeyboardAvoidingView component for that and to find the OS you can make use of the Platform component , both available in the react-native library ,

    <KeyboardAvoidingView
      behavior={Platform.OS === 'ios' ? 'padding' : undefined}
      keyboardVerticalOffset={-500} // Adjust this value as needed
      style={{ flex: 1 }}
    >
      {/* Your screen's content goes here */}
    </KeyboardAvoidingView>
    Login or Signup to reply.
  2. From what I understand, you want to disable the autocomplete option.
    Based on the documentation of React Native V0.71
    React Native – TextInput Docs

    You can try to disable the autocorrect and select as none the content type of the text. Like the following example code.

    <TextInput textContentType="none" autoCorrect={false} />
    

    I hope it is the answer to your problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search