From d29e2190a953c7ce3432f5e705ad1459668e70bc Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 9 Jun 2026 10:00:28 -0400 Subject: [PATCH] fix(uns): reset TagConfig when the operator switches drivers (F-uns-1 integration review) --- .../Components/Shared/Uns/TagModal.razor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor index c88e68c6..b03337fd 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/TagModal.razor @@ -42,7 +42,7 @@
- + @foreach (var (id, display, _) in Drivers) { @@ -156,6 +156,11 @@ private string? SelectedDriverType => Drivers.FirstOrDefault(d => d.Id == _form.DriverInstanceId).DriverType; + // When the operator switches drivers, the previous driver's TagConfig schema no longer applies — + // reset it so the newly-dispatched typed editor starts clean (no stale/leaked keys from the old + // driver). Fires only on a user dropdown change (@bind-Value:after), not on the initial edit-load. + private void OnDriverChanged() => _form.TagConfig = "{}"; + private IDictionary BuildEditorParameters() => new Dictionary { ["ConfigJson"] = _form.TagConfig,