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

This commit is contained in:
Steven Nguyen
2024-05-01 15:38:11 -07:00
parent 35e299f1da
commit 018c9b7f65
+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();