xamous / react-native-smooth-pincode-input

A cross-platform, smooth, lightweight, customizable PIN code input component for React Native.
MIT License
397 stars 137 forks source link

keyboardInput = {number-pad} doesnt work #36

Open Razvancbalaci opened 5 years ago

Razvancbalaci commented 5 years ago

Hello, im trying to put keyboardInput = {number-pad} but it doesnt work.

Heres my code:

pinenter = (
  <View style={styles.container}>
    <Text style={styles.title}>Insira o PIN</Text>

    <SmoothPinCodeInput
      placeholder={<View style={{
        width: 10,
        height: 10,
        borderRadius: 25,
        opacity: 0.3,
        backgroundColor: 'blue',
      }}></View>}
      mask={<View style={{
        width: 10,
        height: 10,
        borderRadius: 25,
        backgroundColor: 'blue',
      }}></View>}
      maskDelay={500}
      restrictToNumbers={true}
      password={true}
      cellStyle={null}
      cellStyleFocused={null}
      value={this.state.codeConf}
      onTextChange={codeConf => this.checkEnter(codeConf, this.state.trueCode)}
      keyboardInput={'number-pad'}
    />
  </View>
)

im using RN0.60

craftmusic commented 4 years ago

use keyboardType="number-pad"

retyui commented 4 years ago

@Razvancbalaci

Thanks for reporting and you can also use better implementation with better maintainability: https://github.com/retyui/react-native-confirmation-code-field

react-native-confirmation-code-field animated example react-native-confirmation-code-field mask example react-native-confirmation-code-field underline example react-native-confirmation-code-field basic example