r5n-labs/react-native-otp-inputs

secureTextEntry not working

Closed this issue · 2 comments

I try use secureTextEntry={true} but didnt work
Platform emulator android

import React, { useState } from 'react';
import { View, Dimensions } from 'react-native';
import OtpInputs from 'react-native-otp-inputs';
const OtpScreen = () => {
  const screenWidth = Dimensions.get('window').width;
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <OtpInputs
        handleChange={code => console.log(code)}
        numberOfInputs={6}
        inputStyles={{
          borderColor: 'black',
          borderWidth: 1,
          borderRadius: 5,
          margin: 10,
          width: screenWidth / 10,
          textAlign: 'center',
          fontSize: 22,
          backgroundColor: 'grey',
        }}
        style={{
          paddingHorizontal: 30,
          width: screenWidth / 1,
          flexDirection: 'row',
        }}
        secureTextEntry={true}
      />
    </View>
  );
};

export default OtpScreen;

Screen Shot 2020-06-23 at 14 53 21

It's a problem with TextInput field (React-Native Issue#26799)
Use KeyboardType="numeric"

Explained here: #23