File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed
Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 159159}
160160
161161.invalid-feedback {
162- display : block ;
163- width : 100% ;
164- margin-top : .25rem ;
165- font-size : .875em ;
166- color : var (--bs-danger );
167-
168162 & [role = " alert" ] {
169163 font-weight : 600 ;
170164 }
Original file line number Diff line number Diff line change @@ -338,10 +338,13 @@ export class AccessibilityManager {
338338 }
339339 }
340340
341- // Handle invalid states
342- htmlInput . addEventListener ( 'invalid' , ( ) => {
343- this . handleFormError ( htmlInput )
344- } )
341+ // Handle invalid state unless the element explicitly opts out via the
342+ // 'disable-adminlte-validations' class.
343+ if ( ! htmlInput . classList . contains ( 'disable-adminlte-validations' ) ) {
344+ htmlInput . addEventListener ( 'invalid' , ( ) => {
345+ this . handleFormError ( htmlInput )
346+ } )
347+ }
345348 } )
346349 }
347350
@@ -354,7 +357,12 @@ export class AccessibilityManager {
354357 errorElement . id = errorId
355358 errorElement . className = 'invalid-feedback'
356359 errorElement . setAttribute ( 'role' , 'alert' )
357- input . parentNode ?. insertBefore ( errorElement , input . nextSibling )
360+
361+ // Always append the error element as the last child of the parent.
362+ // This prevents breaking layouts where inputs use Bootstrap's
363+ // `.input-group-text` decorators, ensuring the error stays below
364+ // the entire input group.
365+ input . parentNode ?. append ( errorElement )
358366 }
359367
360368 errorElement . textContent = input . validationMessage
You can’t perform that action at this time.
0 commit comments