@@ -39,8 +39,6 @@ abstract class BaseColumn extends BaseObject
39
39
const TYPE_RADIO = 'radio ' ;
40
40
const TYPE_DRAGCOLUMN = 'dragColumn ' ;
41
41
42
- const TABINDEX = 1 ;
43
-
44
42
const DEFAULT_STATIC_COLUMN_NAME = 'static-column ' ;
45
43
46
44
/**
@@ -366,11 +364,7 @@ protected function renderDropDownList($name, $value, $options)
366
364
if ($ this ->renderer ->isBootstrapTheme ()) {
367
365
Html::addCssClass ($ options , 'form-control ' );
368
366
}
369
-
370
- if (!isset ($ options ['tabindex ' ])) {
371
- $ options ['tabindex ' ] = self ::TABINDEX ;
372
- }
373
-
367
+
374
368
return Html::dropDownList ($ name , $ value , $ this ->prepareItems ($ this ->items ), $ options );
375
369
}
376
370
@@ -402,11 +396,7 @@ protected function renderListBox($name, $value, $options)
402
396
if ($ this ->renderer ->isBootstrapTheme ()) {
403
397
Html::addCssClass ($ options , 'form-control ' );
404
398
}
405
-
406
- if (!isset ($ options ['tabindex ' ])) {
407
- $ options ['tabindex ' ] = self ::TABINDEX ;
408
- }
409
-
399
+
410
400
return Html::listBox ($ name , $ value , $ this ->prepareItems ($ this ->items ), $ options );
411
401
}
412
402
@@ -433,10 +423,6 @@ protected function renderHiddenInput($name, $value, $options)
433
423
*/
434
424
protected function renderRadio ($ name , $ value , $ options )
435
425
{
436
- if (!isset ($ options ['tabindex ' ])) {
437
- $ options ['tabindex ' ] = self ::TABINDEX ;
438
- }
439
-
440
426
if (!isset ($ options ['label ' ])) {
441
427
$ options ['label ' ] = '' ;
442
428
}
@@ -460,10 +446,6 @@ protected function renderRadio($name, $value, $options)
460
446
*/
461
447
protected function renderRadioList ($ name , $ value , $ options )
462
448
{
463
- if (!isset ($ options ['tabindex ' ])) {
464
- $ options ['tabindex ' ] = self ::TABINDEX ;
465
- }
466
-
467
449
if (!array_key_exists ('unselect ' , $ options )) {
468
450
$ options ['unselect ' ] = '' ;
469
451
}
@@ -473,7 +455,6 @@ protected function renderRadioList($name, $value, $options)
473
455
'label ' => $ label ,
474
456
'value ' => $ value ,
475
457
'data-id ' => ArrayHelper::getValue ($ options , 'id ' ),
476
- 'tabindex ' => self ::TABINDEX
477
458
]);
478
459
479
460
return Html::tag ('div ' , $ content , ['class ' => 'radio ' ]);
@@ -494,10 +475,6 @@ protected function renderRadioList($name, $value, $options)
494
475
*/
495
476
protected function renderCheckbox ($ name , $ value , $ options )
496
477
{
497
- if (!isset ($ options ['tabindex ' ])) {
498
- $ options ['tabindex ' ] = self ::TABINDEX ;
499
- }
500
-
501
478
if (!isset ($ options ['label ' ])) {
502
479
$ options ['label ' ] = '' ;
503
480
}
@@ -521,10 +498,6 @@ protected function renderCheckbox($name, $value, $options)
521
498
*/
522
499
protected function renderCheckboxList ($ name , $ value , $ options )
523
500
{
524
- if (!isset ($ options ['tabindex ' ])) {
525
- $ options ['tabindex ' ] = self ::TABINDEX ;
526
- }
527
-
528
501
if (!array_key_exists ('unselect ' , $ options )) {
529
502
$ options ['unselect ' ] = '' ;
530
503
}
@@ -534,7 +507,6 @@ protected function renderCheckboxList($name, $value, $options)
534
507
'label ' => $ label ,
535
508
'value ' => $ value ,
536
509
'data-id ' => ArrayHelper::getValue ($ options , 'id ' ),
537
- 'tabindex ' => self ::TABINDEX
538
510
]);
539
511
540
512
return Html::tag ('div ' , $ content , ['class ' => 'checkbox ' ]);
@@ -555,10 +527,6 @@ protected function renderCheckboxList($name, $value, $options)
555
527
*/
556
528
protected function renderStatic ($ name , $ value , $ options )
557
529
{
558
- if (!isset ($ options ['tabindex ' ])) {
559
- $ options ['tabindex ' ] = self ::TABINDEX ;
560
- }
561
-
562
530
if ($ this ->renderer ->isBootstrapTheme ()) {
563
531
Html::addCssClass ($ options , 'form-control-static ' );
564
532
}
@@ -604,10 +572,6 @@ protected function renderDefault($name, $value, $options)
604
572
$ type = $ this ->type ;
605
573
606
574
if (method_exists ('yii\helpers\Html ' , $ type )) {
607
- if (!isset ($ options ['tabindex ' ])) {
608
- $ options ['tabindex ' ] = self ::TABINDEX ;
609
- }
610
-
611
575
if ($ this ->renderer ->isBootstrapTheme ()) {
612
576
Html::addCssClass ($ options , 'form-control ' );
613
577
}
@@ -633,10 +597,15 @@ protected function renderDefault($name, $value, $options)
633
597
*/
634
598
protected function renderWidget ($ type , $ name , $ value , $ options )
635
599
{
636
-
637
- $ tabindex = isset ($ options ['options ' ]['tabindex ' ]) ? $ options ['options ' ]['tabindex ' ] : self ::TABINDEX ;
638
- unset($ options ['tabindex ' ]);
639
-
600
+ if (isset ($ options ['options ' ]['tabindex ' ])) {
601
+ $ tabindex = $ options ['options ' ]['tabindex ' ];
602
+ } elseif (isset ($ options ['tabindex ' ])) {
603
+ $ tabindex = $ options ['tabindex ' ];
604
+ unset($ options ['tabindex ' ]);
605
+ } else {
606
+ $ tabindex = null ;
607
+ }
608
+
640
609
$ id = isset ($ options ['id ' ]) ? $ options ['id ' ] : $ this ->normalize ($ name );
641
610
$ model = $ this ->getModel ();
642
611
if ($ model instanceof Model) {
0 commit comments