@@ -125,7 +125,7 @@ class Pattern extends BasePattern {
125
125
) ;
126
126
}
127
127
128
- get disableable ( ) {
128
+ get disableables ( ) {
129
129
// Return all elements, which should be disabled when there are errors.
130
130
return [ ...this . form . elements ] . filter ( ( input ) =>
131
131
input . matches ( this . options . disableSelector )
@@ -302,23 +302,23 @@ class Pattern extends BasePattern {
302
302
const max_values = input_options . maxValues !== null && parseInt ( input_options . maxValues , 10 ) || null ;
303
303
304
304
let number_values = 0 ;
305
- for ( const _inp of this . siblings ( input ) ) {
305
+ for ( const _input of this . siblings ( input ) ) {
306
306
// Check if checkboxes or radios are checked ...
307
- if ( _inp . type === "checkbox" || _inp . type === "radio" ) {
308
- if ( _inp . checked ) {
307
+ if ( _input . type === "checkbox" || _input . type === "radio" ) {
308
+ if ( _input . checked ) {
309
309
number_values ++ ;
310
310
}
311
311
continue ;
312
312
}
313
313
314
314
// Select, if select is selected.
315
- if ( _inp . tagName === "SELECT" ) {
316
- number_values += _inp . selectedOptions . length ;
315
+ if ( _input . tagName === "SELECT" ) {
316
+ number_values += _input . selectedOptions . length ;
317
317
continue ;
318
318
}
319
319
320
320
// For the rest a value must be set.
321
- if ( _inp . value === 0 || _inp . value ) {
321
+ if ( _input . value === 0 || _input . value ) {
322
322
number_values ++ ;
323
323
}
324
324
}
@@ -454,21 +454,21 @@ class Pattern extends BasePattern {
454
454
// Get all inputs with the same name - e.g. radio buttons, checkboxes.
455
455
inputs = this . siblings ( input ) ;
456
456
}
457
- for ( const it of inputs ) {
457
+ for ( const _input of inputs ) {
458
458
if ( clear_state ) {
459
- this . set_error ( { input : it , msg : "" , skip_event : true } ) ;
459
+ this . set_error ( { input : _input , msg : "" , skip_event : true } ) ;
460
460
}
461
- const error_node = it [ KEY_ERROR_EL ] ;
462
- it [ KEY_ERROR_EL ] = null ;
461
+ const error_node = _input [ KEY_ERROR_EL ] ;
462
+ _input [ KEY_ERROR_EL ] = null ;
463
463
error_node ?. remove ( ) ;
464
464
}
465
465
466
466
// disable selector
467
467
if ( this . form . checkValidity ( ) ) {
468
- for ( const it of this . disableable ) {
469
- if ( it . disabled ) {
470
- it . removeAttribute ( "disabled" ) ;
471
- it . classList . remove ( "disabled" ) ;
468
+ for ( const _input of this . disableables ) {
469
+ if ( _input . disabled ) {
470
+ _input . removeAttribute ( "disabled" ) ;
471
+ _input . classList . remove ( "disabled" ) ;
472
472
}
473
473
}
474
474
}
@@ -490,7 +490,7 @@ class Pattern extends BasePattern {
490
490
// Do not set a error message for a input group like radio buttons or
491
491
// checkboxes where one has already been set.
492
492
const inputs = this . siblings ( input ) ;
493
- if ( inputs . length > 1 && inputs . some ( ( it ) => ! ! it [ KEY_ERROR_EL ] ) ) {
493
+ if ( inputs . length > 1 && inputs . some ( ( _input ) => ! ! _input [ KEY_ERROR_EL ] ) ) {
494
494
// error message for input group already set.
495
495
return ;
496
496
}
@@ -507,15 +507,15 @@ class Pattern extends BasePattern {
507
507
input [ KEY_ERROR_EL ] = error_node ;
508
508
509
509
let did_disable = false ;
510
- for ( const it of this . disableable ) {
510
+ for ( const _input of this . disableables ) {
511
511
// Disable for melements if they are not already disabled and which
512
512
// do not have set the `formnovalidate` attribute, e.g.
513
513
// `<button formnovalidate>cancel</button>`.
514
- if ( ! it . disabled && ! it . formNoValidate ) {
514
+ if ( ! _input . disabled && ! _input . formNoValidate ) {
515
515
did_disable = true ;
516
- it . setAttribute ( "disabled" , "disabled" ) ;
517
- it . classList . add ( "disabled" ) ;
518
- logger . debug ( "Disable element" , it ) ;
516
+ _input . setAttribute ( "disabled" , "disabled" ) ;
517
+ _input . classList . add ( "disabled" ) ;
518
+ logger . debug ( "Disable element" , _input ) ;
519
519
}
520
520
}
521
521
0 commit comments