mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Autofocus confirm modal input
This commit is contained in:
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>
|
||||
|
Loading…
Reference in New Issue
Block a user