Added focusing for capacitor input box in invoice validation
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user