1
0
forked from poc/pds

Added focusing for capacitor input box in invoice validation

This commit is contained in:
dhanabalan
2025-07-16 18:20:31 +05:30
parent a34b55267d
commit 72704a4a3f
3 changed files with 31 additions and 0 deletions

View File

@@ -159,3 +159,28 @@
input.focus(); // Set focus to the input field
});
</script> --}}
<script>
window.addEventListener('focus-capacitor-input', () => {
setTimeout(() => {
const input = document.getElementById('capacitorInput');
if (input) {
input.focus();
input.select();
}
}, 50);
});
window.addEventListener('focus-serial-number', () => {
setTimeout(() => {
const container = document.getElementById('serial_number_input');
const input = container?.querySelector('input'); // gets the actual input inside
if (input) {
input.focus();
input.select();
}
}, 100);
});
</script>