React-otp-input

ShouldAutoFocus is not working while entering invalid input. the focus is staying at last box after entering invalid input