Open imanshul opened 10 months ago
Facing similar issue on all iOS simulators.
You're right for a quick fix, you can use the debounce function from lodash
import debounce from 'lodash/debounce';
import OTPInputView from '@twotalltotems/react-native-otp-input';
export default function App() {
const onCodeFilled = debounce((code) => {
sendCode(code, navigation);
}, 500)
return (
<OTPInputView
pinCount={4}
onCodeFilled={onCodeFilled}
/>
);
}
Describe the bug When user type in iOS, the onCodeChanged method is being called twice for every letter, this is only happening for iOS and working fine in Android
To Reproduce Steps to reproduce the behavior:
Smartphone (please complete the following information):