mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-01 04:14:28 +01:00
Autofocus confirm modal input
This commit is contained in:
committed by
Andrew Camilleri
parent
bb4a28ecd8
commit
2f1df3be7d
@@ -27,7 +27,7 @@
|
||||
$text.removeAttribute('hidden')
|
||||
$continue.setAttribute('disabled', 'disabled')
|
||||
$inputText.textContent = confirmInput
|
||||
$input.setAttribute("autocomplete", "off");
|
||||
$input.setAttribute("autocomplete", "off")
|
||||
$input.addEventListener('input', event => {
|
||||
event.target.value.trim() === confirmInput
|
||||
? $continue.removeAttribute('disabled')
|
||||
@@ -38,4 +38,12 @@
|
||||
$continue.removeAttribute('disabled')
|
||||
}
|
||||
});
|
||||
modal.addEventListener('shown.bs.modal', event => {
|
||||
const $target = event.relatedTarget
|
||||
const $input = document.getElementById('ConfirmInput')
|
||||
const { confirmInput } = $target.dataset
|
||||
if (confirmInput) {
|
||||
$input.focus();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user