Add auto-submit logic

This commit is contained in:
Matej Bačo authored and Torsten Dittmann committed 2024-02-27 20:08:51 +01:00
1 parent faad1454a0
commit fa1050d02d
1 file changed
+6
@@ -20,6 +20,12 @@
defaultValue: value.split(''),
onValueChange: ({ next }) => {
value = next.join('');
if (value.length === 6) {
const firstInputElement = element.querySelector('input');
firstInputElement?.form.requestSubmit();
}
return next;
}
});