From 967118226c117b8f5884824c915f4dbdcc84fb1d Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Nov 2021 22:48:06 +0300 Subject: [PATCH 1/6] Fix class attribute in listBox() and dropDownList() of ActiveField --- src/ActiveField.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ActiveField.php b/src/ActiveField.php index 22e5036..1f73c52 100644 --- a/src/ActiveField.php +++ b/src/ActiveField.php @@ -117,7 +117,7 @@ class ActiveField extends \yii\widgets\ActiveField * * If you set a custom `id` for the input element, you may need to adjust the [[$selectors]] accordingly. * - * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. + * @see Html::renderTagAttributes() for details on how attributes are being rendered. * @since 2.0.7 */ public $checkOptions = [ @@ -132,7 +132,7 @@ class ActiveField extends \yii\widgets\ActiveField * * If you set a custom `id` for the input element, you may need to adjust the [[$selectors]] accordingly. * - * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. + * @see Html::renderTagAttributes() for details on how attributes are being rendered. * @since 2.0.7 */ public $radioOptions = [ @@ -431,6 +431,8 @@ class ActiveField extends \yii\widgets\ActiveField if ($this->form->layout === ActiveForm::LAYOUT_INLINE) { Html::removeCssClass($this->labelOptions, 'visually-hidden'); } + Html::removeCssClass($options, 'form-control'); + Html::addCssClass($options, ['widget' => 'form-select']); return parent::listBox($items, $options); } @@ -443,6 +445,8 @@ class ActiveField extends \yii\widgets\ActiveField if ($this->form->layout === ActiveForm::LAYOUT_INLINE) { Html::removeCssClass($this->labelOptions, 'visually-hidden'); } + Html::removeCssClass($options, 'form-control'); + Html::addCssClass($options, ['widget' => 'form-select']); return parent::dropdownList($items, $options); } From 2072e8f42ebbd2eea040e44dd5acdc72d8d6e165 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Nov 2021 22:49:58 +0300 Subject: [PATCH 2/6] Update ActiveField.php --- src/ActiveField.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ActiveField.php b/src/ActiveField.php index 1f73c52..9b3e359 100644 --- a/src/ActiveField.php +++ b/src/ActiveField.php @@ -117,7 +117,7 @@ class ActiveField extends \yii\widgets\ActiveField * * If you set a custom `id` for the input element, you may need to adjust the [[$selectors]] accordingly. * - * @see Html::renderTagAttributes() for details on how attributes are being rendered. + * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. * @since 2.0.7 */ public $checkOptions = [ @@ -132,7 +132,7 @@ class ActiveField extends \yii\widgets\ActiveField * * If you set a custom `id` for the input element, you may need to adjust the [[$selectors]] accordingly. * - * @see Html::renderTagAttributes() for details on how attributes are being rendered. + * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. * @since 2.0.7 */ public $radioOptions = [ From b627bdd84024dbe9cd1b9688ecafc9921a379d0c Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Nov 2021 22:59:54 +0300 Subject: [PATCH 3/6] Update ActiveFormTest.php --- tests/ActiveFormTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ActiveFormTest.php b/tests/ActiveFormTest.php index 0c150db..ef26aab 100644 --- a/tests/ActiveFormTest.php +++ b/tests/ActiveFormTest.php @@ -171,7 +171,7 @@ HTML; $expected2 = << -