Made autofocus more consistent
This commit is contained in:
parent
717624a922
commit
193703ff5a
2 changed files with 15 additions and 8 deletions
|
|
@ -42,15 +42,17 @@ async function loadCash(price) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function indexOnLoad(){
|
async function indexOnLoad(){
|
||||||
document.body.addEventListener('click', focusBarcodeInput, true);
|
// document.body.addEventListener('click', focusBarcodeInput, true);
|
||||||
loadProducts();
|
loadProducts();
|
||||||
document.querySelector("input[autofocus]").addEventListener("blur", function() {
|
|
||||||
var t = this;
|
const bardcodeInputField = document.getElementById('barcode_form')
|
||||||
t.focus();
|
bardcodeInputField.focus()
|
||||||
setTimeout(function() { // Some browsers won't let you do it until
|
|
||||||
t.focus(); // after the blur has completed
|
bardcodeInputField.addEventListener('blur', function() {
|
||||||
}, 100);
|
setTimeout(() => {
|
||||||
});
|
bardcodeInputField.focus();
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function focusBarcodeInput(){
|
function focusBarcodeInput(){
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
body{
|
body{
|
||||||
background-color: #D9F2D0;
|
background-color: #D9F2D0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue