How to add backspace and tab tothis autofocus ?(reactjs)

const secondInput = useRef();
  const thirdInput = useRef();
   const fourthInput = useRef();
   const fifthInput = useRef();
   const sixthInput = useRef();
 <input
                className="m-2 text-center form-control rounded otp-field"
                type="text"
                id="second"
                name="second"
                onChange={() => thirdInput.current.focus()}
               
                onKeyPress={(e) => restrictNumber(e)}
                maxlength="1"
                ref={secondInput}

I’m not sure I understand exactly what you are asking. Also, it would probably be helpful if you provided a link to the project and code instead of this small incomplete snippet.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.