File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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' )){
You can’t perform that action at this time.
0 commit comments