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 <noreply@anthropic.com>
This commit is contained in:
Martino Ferrari
2026-08-17 00:52:04 +02:00
co-authored by Claude Sonnet 4.6
parent 4e3a90b2c6
commit 4908c039a5
+3 -1
View File
@@ -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')]