Closed WhyFenceCode closed 17 hours ago
This features already exist just pass attribute autoFocus
to InputOTP
component
const InputWithAutoFocus = () => {
return (
<InputOTP maxLength={6} autoFocus> {/* <- autoFocus as boolean */}
<InputOTPGroup>
<InputOTPSlot index={0} />
<InputOTPSlot index={1} />
<InputOTPSlot index={2} />
</InputOTPGroup>
<InputOTPSeparator />
<InputOTPGroup>
<InputOTPSlot index={3} />
<InputOTPSlot index={4} />
<InputOTPSlot index={5} />
</InputOTPGroup>
</InputOTP>
);
};
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.
Feature description
I am wondering if we can add some simple code to the Input-OTP object that makes the first box of the Input-OTP object get selected when it begins to render. This should be a simple bool just like disabled, so that it can quickly work and is easy to use.
Affected component/components
Input-OTP
Additional Context
No response
Before submitting