I have an otp input field and I want it to be autofocused on initial rendering(using hooks, smart and dumb component) The field is inside an IonModal
import OtpInput from "react-otp-input";
import {IonInput, IonModal} from '@ionic/react';
<IonModal isOpen={true} cssClass={classes.someClass} showBackdrop={false} >
<OtpInput
shouldAutoFocus={true}
value={props.otp}
numInputs={6}
/>
</IonModal>
I want specifically OtpInput but I also tried with IonInput, it's also not autofocusable
<IonInput
autofocus={true}
type="number"
label="Enter OTP"
/>
tried autofocus attribute, document.querySelecterAll, couldnt try document.getElementById cause somehow Id is not showing on the element
What I am missing?