Skip to content

Commit

Permalink
Merge pull request #1413 from DissNik/3.x-json
Browse files Browse the repository at this point in the history
[3.x] fields ids for Json
  • Loading branch information
lee-to authored Dec 22, 2024
2 parents 23b0bc5 + f83885f commit d4adcc9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/UI/src/Collections/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d4adcc9

Please sign in to comment.