diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor index 8c6d5df6..7ce3552f 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/Uns/VirtualTagModal.razor @@ -329,14 +329,16 @@ return; } - // Bind the new script and load its (blank) source so the inline editor renders + expands. - _form.ScriptId = result.CreatedId; - await LoadScriptSourceAsync(); - // Make the freshly-created script a real option in the dropdown so the select stays coherent. + // Add the new script to the options list BEFORE setting the selected value so the + // can resolve the label on first render — if we set ScriptId first the + // dropdown has no matching