automatically select the search input when the start of a scanned uuid is detected

This commit is contained in:
Stefan Strobel 2024-11-18 23:55:12 +01:00
parent b9d788935d
commit 9afa7d709b

View File

@ -83,6 +83,14 @@
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]') const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl)) const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
</script> </script>
<!-- Select search field on start of QR scan ([) -->
<script type="text/javascript">
window.addEventListener("keydown", (event)=>{
if (event.key == '[') {
document.getElementById("qr_search_field").focus()
}
})
</script>
{% block custom_scripts %} {% block custom_scripts %}
{% endblock custom_scripts %} {% endblock custom_scripts %}