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,