react-native-advanced-input-mask: Not working on iOS?
Hey there, I’m having trouble getting this library to work on iOS. I can type values into the input field but the mask never applies, and neither do I ever see anything logged in the onChangeText function.
I’ve created a very basic Snack here to test this with. When I use “Web”, the mask seems to work and apply correctly, but when I connect it to my device through Expo Go, I can just freely type in any value and no mask ever applies.
https://snack.expo.dev/qYb3gKHm4O3XtjGvCcNvU
I also added this to my project with the following snippet of code:
<MaskedTextInput
mask="[099].[99]"
style={[styles.input]}
value={value}
keyboardType="numeric"
onFocus={() => console.log("MaskedTextInput Focused!")}
onChangeText={(formatted, extracted) => {
console.log("formatted ->", formatted);
console.log("extracted ->", extracted);
}}
/>
I found that the onFocus console.log runs every time, however I never see the onChangeText function log anything ever.
Is there something I’m missing?
Appreciate any help, thank you!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (9 by maintainers)
@Dominic-Preap You can use this code to avoid multiline text input usage:
Hello @jamesofficer
Expo Go is a sandbox environment which doesn’t actually build native code. Could you try to use development builds instead, because this library contains native code.