fix(kiosko): teclado táctil Windows reaparece al tocar el campo
- blur() en mostrarTicket, seleccionarOtraPrioridad y volverPrioridades para que ningún campo quede enfocado al cambiar de pantalla - pointerup en cada input: si ya estaba enfocado, blur+focus(30ms) fuerza a Windows a reinvocar el teclado táctil - El focus programático de seleccionarPrioridad se conserva (escáner) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4d75f82b30
commit
aaeb3567c2
@@ -577,6 +577,20 @@ unset($p);
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ── Teclado táctil Windows ────────────────────────────────────────
|
||||||
|
// Si el campo ya está enfocado (por código), un toque no dispara focus
|
||||||
|
// y Windows no muestra el teclado. Solución: blur + focus en pointerup.
|
||||||
|
function _forzarTecladoTactil(inp) {
|
||||||
|
inp.addEventListener('pointerup', () => {
|
||||||
|
if (document.activeElement === inp) {
|
||||||
|
inp.blur();
|
||||||
|
setTimeout(() => inp.focus(), 30);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_forzarTecladoTactil(_inpCedula);
|
||||||
|
_forzarTecladoTactil(document.getElementById('inp-cel'));
|
||||||
|
|
||||||
function resetInactividad() {
|
function resetInactividad() {
|
||||||
clearTimeout(_timerInactividad);
|
clearTimeout(_timerInactividad);
|
||||||
_timerInactividad = setTimeout(() => {
|
_timerInactividad = setTimeout(() => {
|
||||||
@@ -602,7 +616,7 @@ unset($p);
|
|||||||
resetInactividad();
|
resetInactividad();
|
||||||
}
|
}
|
||||||
|
|
||||||
function volverPrioridades() { clearTimeout(_timerInactividad); mostrar('screen-prio'); }
|
function volverPrioridades() { clearTimeout(_timerInactividad); document.activeElement?.blur(); mostrar('screen-prio'); }
|
||||||
|
|
||||||
let _enviando = false;
|
let _enviando = false;
|
||||||
async function confirmarTurno() {
|
async function confirmarTurno() {
|
||||||
@@ -637,6 +651,7 @@ unset($p);
|
|||||||
|
|
||||||
function mostrarTicket(t) {
|
function mostrarTicket(t) {
|
||||||
setSpinner(false);
|
setSpinner(false);
|
||||||
|
document.activeElement?.blur();
|
||||||
document.getElementById('tick-codigo').textContent = t.codigo;
|
document.getElementById('tick-codigo').textContent = t.codigo;
|
||||||
document.getElementById('tick-codigo').style.color = prioColor;
|
document.getElementById('tick-codigo').style.color = prioColor;
|
||||||
document.getElementById('tick-nombre').textContent = t.paciente_nombre || '';
|
document.getElementById('tick-nombre').textContent = t.paciente_nombre || '';
|
||||||
@@ -654,6 +669,7 @@ unset($p);
|
|||||||
function seleccionarOtraPrioridad() {
|
function seleccionarOtraPrioridad() {
|
||||||
clearTimeout(window._timer);
|
clearTimeout(window._timer);
|
||||||
clearTimeout(_timerInactividad);
|
clearTimeout(_timerInactividad);
|
||||||
|
document.activeElement?.blur();
|
||||||
document.getElementById('inp-cedula').value = '';
|
document.getElementById('inp-cedula').value = '';
|
||||||
document.getElementById('inp-cel').value = '';
|
document.getElementById('inp-cel').value = '';
|
||||||
prioCodigo = prioNombre = prioColor = '';
|
prioCodigo = prioNombre = prioColor = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user