tttstudios / react-native-otp-input

Tiny Javascript library which provides an elegant UI for user to input one time passcode.
MIT License
542 stars 243 forks source link

fix: filter out unwanted `Backspace` events for some CJK IMEs #94

Open stackia opened 4 years ago

stackia commented 4 years ago

With some CJK keyboards (like Sogou IME for Chinese on Android), we might receive an unwanted Backspace key event right after we focus to the next field. Such unwanted Backspace events will delete characters we've just input like this:

ezgif com-video-to-gif

This PR added a time check to filter out any Backspace events happened within 200ms after the last successful input. While solved the problem, it seems a bit tricky but I cannot find a better solution to handle such cases.

fpena commented 4 years ago

Thanks for this. We will review it.

aklevko commented 3 years ago

When this PR will be merged?