From 967118226c117b8f5884824c915f4dbdcc84fb1d Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 30 Nov 2021 22:48:06 +0300 Subject: [PATCH] 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); }