react-native-otp-entry
react-native-otp-entry copied to clipboard
Focus indicator always shows last available input when in reality I can focus first input and remove/add digits there
Describe the bug When I unfocus from otp or turn off keyboard, and then I press first input box, the focus indicator is on the last digit, but when I press backspace it deletes digits from the start of the text. When this happens, it only allows me to delete like 2 digits, and I can't delete any more. I have to click around and press backspace in between the clicks to remove the whole input
Just now as writing the ticket, user even when already focused can press the first input, and whatever he will type will appear after the first digit.
To Reproduce Steps to reproduce the behavior:
- Have an OTP input with e.g. 6 digits with autofocus
- input e.g. 4 digits
- press system back button to hide keyboard and unfocus
- click first input box (keyboard will reappear and the focus indicator will be on the last empty input)
- press backspace on the keyboard to remove digits (digits from the start of the strings will be deleted, but only e.g. 2 of them)
- try to input some digits after doing this, they will appear in the starting inputs
Expected behavior On any input box click focus to the last empty/last in general input box
Environment (please complete the following information):
- OS: Android
- Library version: 1.8.4
- React Native version: 0.75.2
Hi @makowskimichal . I was not able to replicate the issue. Can you please attach a demo?
Seems like similar issue, I filled the otps but when i press on first otp input it starts showing green indicator
I see. Have you searched for ways to disable the "pointer" of TextInput?
I have applied this and it fixed the issue
textInputProps={{ caretHidden: true, contextMenuHidden: true }} //Remove that single green caret symbol
@mantu-bit nice catch! But I assume caretHidden: true should be enough to resolve the problem of green caret, right?
Note: when disabling caret, you also lose the capability of contextMenu. It does not show up when the carretHidden: true on Android