diff --git a/src/UI/resources/views/components/field-container.blade.php b/src/UI/resources/views/components/field-container.blade.php index 9f39ac01e..a40a3f10a 100644 --- a/src/UI/resources/views/components/field-container.blade.php +++ b/src/UI/resources/views/components/field-container.blade.php @@ -1,6 +1,7 @@ {{-- @internal --}} @props([ 'label' => '', + 'formName' => '', 'errors' => [], 'isBeforeLabel' => false, 'isInsideLabel' => false, @@ -13,6 +14,7 @@ '', + 'formName' => '', 'fieldErrors' => [], 'beforeLabel' => false, 'insideLabel' => false, @@ -7,14 +8,14 @@ 'after', ])
merge(['class' => 'form-group moonshine-field'])->except('required') }} - x-id="['input-wrapper', 'field']" :id="$id('input-wrapper')" + x-id="['input-wrapper', 'field-{{ $formName }}']" :id="$id('input-wrapper')" > {{ $beforeLabel && !$insideLabel ? $slot : '' }} @if($label) {{ $beforeLabel && $insideLabel ? $slot : '' }} {!! $label !!} diff --git a/src/UI/src/Fields/FieldContainer.php b/src/UI/src/Fields/FieldContainer.php index 76b3550f4..7b3c37d90 100644 --- a/src/UI/src/Fields/FieldContainer.php +++ b/src/UI/src/Fields/FieldContainer.php @@ -66,6 +66,7 @@ protected function viewData(): array { return [ 'label' => $this->field->getLabel(), + 'formName' => $this->field->getFormName(), 'errors' => data_get($this->field->getErrors(), $this->field->getNameDot()),