Fix FLEXIAPI-393 Autofill the digits when pasting a code

This commit is contained in:
Timothée Jaussoin 2025-09-30 11:56:33 +02:00
parent b0de4841f6
commit 10cdbb4b6a
2 changed files with 15 additions and 6 deletions

View file

@ -18,6 +18,7 @@ v2.1
- Fix FLEXIAPI-391 Add missing account view attribute in the actions.delete view
- Fix FLEXIAPI-392 Fix the recover_by_code view and use the account space object
- Fix FLEXIAPI-395 Remove config()->set('app.sip_domain') and directly use the correct domain
- Fix FLEXIAPI-393 Autofill the digits when pasting a code
v2.0
----

View file

@ -113,6 +113,14 @@ document.addEventListener("DOMContentLoaded", function(event) {
function digitFilled(element) {
if (element.value.length == 1) {
element.nextElementSibling.focus();
} else if (element.value.length == 4 && element.previousElementSibling == undefined) {
var spread = new String(element.value);
element.value = spread[0];
element.nextElementSibling.value = spread[1];
element.nextElementSibling.nextElementSibling.value = spread[2];
element.nextElementSibling.nextElementSibling.nextElementSibling.value = spread[3];
} else {
element.value = '';
}
}