@@ -367,7 +367,9 @@ protected function renderDropDownList($name, $value, $options)
367
367
Html::addCssClass ($ options , 'form-control ' );
368
368
}
369
369
370
- $ options ['tabindex ' ] = self ::TABINDEX ;
370
+ if (!isset ($ options ['tabindex ' ])) {
371
+ $ options ['tabindex ' ] = self ::TABINDEX ;
372
+ }
371
373
372
374
return Html::dropDownList ($ name , $ value , $ this ->prepareItems ($ this ->items ), $ options );
373
375
}
@@ -401,7 +403,9 @@ protected function renderListBox($name, $value, $options)
401
403
Html::addCssClass ($ options , 'form-control ' );
402
404
}
403
405
404
- $ options ['tabindex ' ] = self ::TABINDEX ;
406
+ if (!isset ($ options ['tabindex ' ])) {
407
+ $ options ['tabindex ' ] = self ::TABINDEX ;
408
+ }
405
409
406
410
return Html::listBox ($ name , $ value , $ this ->prepareItems ($ this ->items ), $ options );
407
411
}
@@ -429,7 +433,9 @@ protected function renderHiddenInput($name, $value, $options)
429
433
*/
430
434
protected function renderRadio ($ name , $ value , $ options )
431
435
{
432
- $ options ['tabindex ' ] = self ::TABINDEX ;
436
+ if (!isset ($ options ['tabindex ' ])) {
437
+ $ options ['tabindex ' ] = self ::TABINDEX ;
438
+ }
433
439
434
440
if (!isset ($ options ['label ' ])) {
435
441
$ options ['label ' ] = '' ;
@@ -454,7 +460,9 @@ protected function renderRadio($name, $value, $options)
454
460
*/
455
461
protected function renderRadioList ($ name , $ value , $ options )
456
462
{
457
- $ options ['tabindex ' ] = self ::TABINDEX ;
463
+ if (!isset ($ options ['tabindex ' ])) {
464
+ $ options ['tabindex ' ] = self ::TABINDEX ;
465
+ }
458
466
459
467
if (!array_key_exists ('unselect ' , $ options )) {
460
468
$ options ['unselect ' ] = '' ;
@@ -465,7 +473,7 @@ protected function renderRadioList($name, $value, $options)
465
473
'label ' => $ label ,
466
474
'value ' => $ value ,
467
475
'data-id ' => ArrayHelper::getValue ($ options , 'id ' ),
468
- 'tabindex ' => self :: TABINDEX
476
+ 'tabindex ' => $ options [ ' tabindex ' ]
469
477
]);
470
478
471
479
return Html::tag ('div ' , $ content , ['class ' => 'radio ' ]);
@@ -486,7 +494,9 @@ protected function renderRadioList($name, $value, $options)
486
494
*/
487
495
protected function renderCheckbox ($ name , $ value , $ options )
488
496
{
489
- $ options ['tabindex ' ] = self ::TABINDEX ;
497
+ if (!isset ($ options ['tabindex ' ])) {
498
+ $ options ['tabindex ' ] = self ::TABINDEX ;
499
+ }
490
500
491
501
if (!isset ($ options ['label ' ])) {
492
502
$ options ['label ' ] = '' ;
@@ -511,7 +521,9 @@ protected function renderCheckbox($name, $value, $options)
511
521
*/
512
522
protected function renderCheckboxList ($ name , $ value , $ options )
513
523
{
514
- $ options ['tabindex ' ] = self ::TABINDEX ;
524
+ if (!isset ($ options ['tabindex ' ])) {
525
+ $ options ['tabindex ' ] = self ::TABINDEX ;
526
+ }
515
527
516
528
if (!array_key_exists ('unselect ' , $ options )) {
517
529
$ options ['unselect ' ] = '' ;
@@ -522,7 +534,7 @@ protected function renderCheckboxList($name, $value, $options)
522
534
'label ' => $ label ,
523
535
'value ' => $ value ,
524
536
'data-id ' => ArrayHelper::getValue ($ options , 'id ' ),
525
- 'tabindex ' => self :: TABINDEX
537
+ 'tabindex ' => $ options [ ' tabindex ' ]
526
538
]);
527
539
528
540
return Html::tag ('div ' , $ content , ['class ' => 'checkbox ' ]);
@@ -543,7 +555,9 @@ protected function renderCheckboxList($name, $value, $options)
543
555
*/
544
556
protected function renderStatic ($ name , $ value , $ options )
545
557
{
546
- $ options ['tabindex ' ] = self ::TABINDEX ;
558
+ if (!isset ($ options ['tabindex ' ])) {
559
+ $ options ['tabindex ' ] = self ::TABINDEX ;
560
+ }
547
561
548
562
if ($ this ->renderer ->isBootstrapTheme ()) {
549
563
Html::addCssClass ($ options , 'form-control-static ' );
@@ -590,7 +604,9 @@ protected function renderDefault($name, $value, $options)
590
604
$ type = $ this ->type ;
591
605
592
606
if (method_exists ('yii\helpers\Html ' , $ type )) {
593
- $ options ['tabindex ' ] = self ::TABINDEX ;
607
+ if (!isset ($ options ['tabindex ' ])) {
608
+ $ options ['tabindex ' ] = self ::TABINDEX ;
609
+ }
594
610
595
611
if ($ this ->renderer ->isBootstrapTheme ()) {
596
612
Html::addCssClass ($ options , 'form-control ' );
@@ -617,7 +633,9 @@ protected function renderDefault($name, $value, $options)
617
633
*/
618
634
protected function renderWidget ($ type , $ name , $ value , $ options )
619
635
{
620
- unset($ options ['tabindex ' ]);
636
+ if (!isset ($ options ['tabindex ' ])) {
637
+ $ options ['tabindex ' ] = self ::TABINDEX ;
638
+ }
621
639
622
640
$ model = $ this ->getModel ();
623
641
if ($ model instanceof Model) {
@@ -628,7 +646,7 @@ protected function renderWidget($type, $name, $value, $options)
628
646
'options ' => [
629
647
'id ' => $ this ->normalize ($ name ),
630
648
'name ' => $ name ,
631
- 'tabindex ' => self :: TABINDEX ,
649
+ 'tabindex ' => $ options [ ' tabindex ' ] ,
632
650
'value ' => $ value
633
651
]
634
652
];
@@ -639,7 +657,7 @@ protected function renderWidget($type, $name, $value, $options)
639
657
'options ' => [
640
658
'id ' => $ this ->normalize ($ name ),
641
659
'name ' => $ name ,
642
- 'tabindex ' => self :: TABINDEX ,
660
+ 'tabindex ' => $ options [ ' tabindex ' ] ,
643
661
'value ' => $ value
644
662
]
645
663
];
0 commit comments