fix(elements): allow InputDigits to auto submit again

If a user inputs an incorrect code, deletes what they put, and then
enters a different code, the InputDigits component should auto submit
again if autoSubmit is true.
This commit is contained in:
Steven Nguyen committed 2024-05-16 11:11:58 -07:00
1 parent 264ce68551
commit 3e7eb80229
1 file changed
+4
@@ -24,6 +24,10 @@
onValueChange: ({ next }) => {
value = next.join('');
if (value.length < length) {
autoSubmitted = false;
}
if (autoSubmit && value.length === length && !autoSubmitted) {
autoSubmitted = true;
const firstInputElement = element.querySelector('input');