CaioQuirinoMedeiros / react-native-mask-input

🎭:iphone: A simple and effective Text Input with mask for ReactNative on iOS and Android. Includes obfuscation characters feature.
https://www.npmjs.com/package/react-native-mask-input
MIT License
305 stars 31 forks source link

Mask working on Android but not iOS #40

Closed imeidopf closed 1 year ago

imeidopf commented 1 year ago

I have this bit of code and it is working on Android but not iOS. On iOS, when you type, the value keeps resetting itself as you type. Any thoughts?

<View style={this.styles.container}> <TextInputMask style={{ height: 40, borderColor: 'gray', borderWidth: 1, color: "#000000" }} type={'custom'} keyboardType="numeric" options={{ mask: '999-99-9999' }} key={this.props.dataAttr.toString()} value={this.props.dataAttr.toString()} onChangeText={this.handleChange} maxLength={this.props.characterLimit > 0 ? this.props.characterLimit : undefined} /> </View>

https://github.com/CaioQuirinoMedeiros/react-native-mask-input/assets/10743319/1bbe6648-d222-4b47-a70d-8a7dfe6966bd

CaioQuirinoMedeiros commented 1 year ago

https://github.com/CaioQuirinoMedeiros/react-native-mask-input#usage

Please, at least read the documentation before opening a issue... there's no options property. Also, the snippet you pasted means nothing without knowing the rest of your component.

Feel free to open a new issue if you really have a problem

CaioQuirinoMedeiros commented 1 year ago

@imeidopf It's obvious why it's not working, you're not using react-native-mask-input... This is where you need to go: https://github.com/bhrott/react-native-masked-text