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')
|
$text.removeAttribute('hidden')
|
||||||
$continue.setAttribute('disabled', 'disabled')
|
$continue.setAttribute('disabled', 'disabled')
|
||||||
$inputText.textContent = confirmInput
|
$inputText.textContent = confirmInput
|
||||||
$input.setAttribute("autocomplete", "off");
|
$input.setAttribute("autocomplete", "off")
|
||||||
$input.addEventListener('input', event => {
|
$input.addEventListener('input', event => {
|
||||||
event.target.value.trim() === confirmInput
|
event.target.value.trim() === confirmInput
|
||||||
? $continue.removeAttribute('disabled')
|
? $continue.removeAttribute('disabled')
|
||||||
@ -38,4 +38,12 @@
|
|||||||
$continue.removeAttribute('disabled')
|
$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>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user