From f83885f51d4dbb3d5524b094537913a53768664d Mon Sep 17 00:00:00 2001 From: Alexander Nikushkin Date: Sat, 21 Dec 2024 19:57:37 +0500 Subject: [PATCH] fix: fields ids for Json issue #1412 --- src/UI/src/Collections/Fields.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UI/src/Collections/Fields.php b/src/UI/src/Collections/Fields.php index c8e5a43db..e245f23ff 100644 --- a/src/UI/src/Collections/Fields.php +++ b/src/UI/src/Collections/Fields.php @@ -257,6 +257,12 @@ public function prepareReindexNames(?FieldContract $parent = null, ?callable $be ->setParent($parent); } + if ($parent && !$field->hasWrapper()) { + $field->customAttributes([ + 'x-id' => "[`field-{$parent->getFormName()}`]", + ]); + } + return $field ->setNameAttribute( \is_null($performName) ? $name : $performName($name, $parent, $field)