Skip to content

Commit 7ccad6f

Browse files
committed
fix error display on prefixed fields
1 parent aa80181 commit 7ccad6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/resources/views/crud/form_content.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,15 @@ function preventUnload(event) {
182182
var field = $('[name="' + normalizedProperty + '[]"]').length ?
183183
$('[name="' + normalizedProperty + '[]"]') :
184184
$('[name="' + normalizedProperty + '"]'),
185-
container = field.parent('.form-group');
185+
container = field.closest('.form-group');
186186
187187
// iterate the inputs to add invalid classes to fields and red text to the field container.
188-
container.children('input, textarea, select').each(function() {
188+
container.find('input, textarea, select').each(function() {
189189
let containerField = $(this);
190-
// add the invalida class to the field.
190+
// add the invalid class to the field.
191191
containerField.addClass('is-invalid');
192192
// get field container
193-
let container = containerField.parent('.form-group');
193+
let container = containerField.closest('.form-group');
194194
195195
// TODO: `repeatable-group` should be deprecated in future version as a BC in favor of a more generic class `no-error-display`
196196
if(!container.hasClass('repeatable-group') && !container.hasClass('no-error-display')){

0 commit comments

Comments
 (0)