fix: otp input field single input limit in auth

This commit is contained in:
Mahyar Khanbolooki
2025-07-02 01:11:05 +03:30
parent 1717d0b503
commit 2f5472ce91
+1
View File
@@ -79,6 +79,7 @@ function AuthIndex({ }: Props) {
const prev = otp.padEnd(6).split(''); const prev = otp.padEnd(6).split('');
prev[index] = e.target.value; prev[index] = e.target.value;
const next = prev.join(''); const next = prev.join('');
if(otp.length >= 6 && next.trim().length >= otp.length) return;
setOtp(next.trimEnd()); setOtp(next.trimEnd());
} }
} }