From 41da78263b60e3356d8903034a6c5e57f331cdba Mon Sep 17 00:00:00 2001 From: Michael Aziz Date: Sat, 24 Jan 2026 18:02:08 +0200 Subject: [PATCH] [FIX] Field Groups hydration --- lib/src/form/src/controller.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/form/src/controller.dart b/lib/src/form/src/controller.dart index 149248c..f2cbe66 100644 --- a/lib/src/form/src/controller.dart +++ b/lib/src/form/src/controller.dart @@ -145,7 +145,7 @@ class AstromicFormController { final def = _groupDefs[groupId]; if (def == null) throw Exception('Group $groupId not registered.'); - final newUuid = DateTime.now().microsecondsSinceEpoch.toString(); + final newUuid = '${DateTime.now().microsecondsSinceEpoch}_${_nodes.length}'; def.schema.forEach((fieldName, config) { final nodeKey = '${groupId}_${fieldName}_$newUuid'; @@ -174,6 +174,9 @@ class AstromicFormController { } void _createTypedNode(String key, AstromicFieldConfig config, T initialValue) { + // FORCE clear if it somehow exists (prevents ghosting) + _nodes.remove(key); + _nodes[key] = AstromicFieldNode( initialValue, formatter: config.formatter ?? (v) => v.toString(),