CaioQuirinoMedeiros / react-native-mask-input

🎭:iphone: A simple and effective Text Input with mask for ReactNative on iOS and Android. Includes obfuscation characters feature.

Home Page:https://www.npmjs.com/package/react-native-mask-input

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird `selection` behavior

nandorojo opened this issue · comments

As I'm typing, it seems that the selection prop is changing randomly. Notice that, as I try to add numbers to the start of the TextInput, the selection suddenly jumps to the end.

humiliated.pretzel.-.Snack.-.18.November.2021.mp4

Code: https://snack.expo.dev/@nandorojo/humiliated-pretzel

Try typing a few numbers, then move the cursor to the start of the input, and type a few more.

Typing with the cursor in any position other than the end is always a struggle in a masked text input (talking about ReactNative). I'll take a look at it as soon as I can, but I'll add that I don't have a good feeling about having it fixed.

Btw, if your need is a currency input you may give a chance to ReactNativeCurrencyInput

Oh cool I’ll try that thanks!

Looks like the cursor issue still exists on that lib, but the precision:0 does work!

Thanks for the quick help btw @CaioQuirinoMedeiros!