fix(mfa): fix value not updating when autoSubmit is false

This commit is contained in:
Steven Nguyen committed 2024-05-01 15:38:11 -07:00
1 parent 35e299f1da
commit 018c9b7f65
1 file changed
+1 -4
+1 -4
View File
@@ -22,12 +22,9 @@
placeholder: '',
defaultValue: value.split(''),
onValueChange: ({ next }) => {
if (!autoSubmit) {
return next;
}
value = next.join('');
if (value.length === length && !autoSubmitted) {
if (autoSubmit && value.length === length && !autoSubmitted) {
autoSubmitted = true;
const firstInputElement = element.querySelector('input');
firstInputElement?.form.requestSubmit();