From 4908c039a549137de1863822bd691c094f401d85 Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Mon, 17 Aug 2026 00:52:04 +0200 Subject: [PATCH] fix(webui): keep cal-invalid styling on focused field during hub broadcast refreshVScaleMenu() was unconditionally removing the cal-invalid class from all three calibration inputs, which silently cleared the red-border error indicator on a field the user was editing whenever a hub calibration broadcast arrived. Apply the same focused-element guard already used for .value writes so a rejected value's error styling persists until the user corrects it. Co-Authored-By: Claude Sonnet 4.6 --- Client/udpstreamer/static/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Client/udpstreamer/static/app.js b/Client/udpstreamer/static/app.js index d23f7c0..42c2783 100644 --- a/Client/udpstreamer/static/app.js +++ b/Client/udpstreamer/static/app.js @@ -3533,7 +3533,9 @@ function refreshVScaleMenu() { if (focused !== scaleEl) scaleEl.value = cal.scale; if (focused !== offsetEl) offsetEl.value = cal.offset; if (focused !== unitEl) unitEl.value = cal.unit; - [scaleEl, offsetEl, unitEl].forEach(el => el.classList.remove('cal-invalid')); + [scaleEl, offsetEl, unitEl].forEach(el => { + if (focused !== el) el.classList.remove('cal-invalid'); + }); const srcLabel = srcLabelForKey(_vsMenuKey); const usable = srcLabel !== '' && base !== ''; [scaleEl, offsetEl, unitEl, document.getElementById('btn-cal-reset')]