diff --git a/src/frontend/flask_app/static/js/numpad.js b/src/frontend/flask_app/static/js/numpad.js index 7a077f3..70154ec 100644 --- a/src/frontend/flask_app/static/js/numpad.js +++ b/src/frontend/flask_app/static/js/numpad.js @@ -163,6 +163,17 @@ function numpad() { * @param {KeyboardEvent} e - The keyboard event */ handleKeydown(e) { + // Ignore keystrokes aimed at an editable field (e.g. the supervisor + // login modal). The numpad has no text inputs of its own, so this + // window-level capture is only meant for the USB caliper / keyboard + // wedge when no field is focused. Without this guard the numpad would + // swallow digits and Backspace inside those inputs. + const t = e.target; + if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || + t.tagName === 'SELECT' || t.isContentEditable)) { + return; + } + // Number keys if (e.key >= '0' && e.key <= '9') { e.preventDefault(); diff --git a/src/frontend/flask_app/templates/measure/task_execute.html b/src/frontend/flask_app/templates/measure/task_execute.html index 198579d..0ab1f52 100644 --- a/src/frontend/flask_app/templates/measure/task_execute.html +++ b/src/frontend/flask_app/templates/measure/task_execute.html @@ -116,14 +116,14 @@ {# Fermo linea + Fine produzione (measurement tasks only) #}