feat: let the /connect code input accept a pasted ABCD-EFGH code by stripping the dash and lowercase through input-otp's pasteTransformer before its alphanumeric pattern check, which was rejecting the whole paste

This commit is contained in:
Matthew Meszaros
2026-08-29 09:19:31 -07:00
parent 41d52723b6
commit febe5bb0d7
+1 -1
View File
@@ -218,7 +218,7 @@ function CodeStep({ code, setCode, loading, error, onRetry }: { code: string; se
</div>
<div className="mt-8 flex justify-center">
<InputOTP maxLength={CODE_LENGTH} value={code} onChange={(v) => setCode(clean(v))} pattern={REGEXP_ONLY_DIGITS_AND_CHARS} autoFocus containerClassName="gap-1.5 sm:gap-2" disabled={loading}>
<InputOTP maxLength={CODE_LENGTH} value={code} onChange={(v) => setCode(clean(v))} pattern={REGEXP_ONLY_DIGITS_AND_CHARS} pasteTransformer={clean} autoFocus containerClassName="gap-1.5 sm:gap-2" disabled={loading}>
<InputOTPGroup className="gap-1.5 sm:gap-2">
{[0, 1, 2, 3].map((i) => (
<Slot key={i} index={i} />