diff --git a/Select2.php b/Select2.php index 1a9a255..4e1d6b1 100644 --- a/Select2.php +++ b/Select2.php @@ -98,10 +98,8 @@ public function init() ) { $this->data = ["" => ""] + $this->data; } - if (!isset($this->options['style'])) { - $this->options['style'] = 'width: 100%'; - } - + Html::addCssClass($this->options, 'form-control'); + Html::addCssStyle($this->options, 'width:100%', false); $this->registerAssets(); $this->renderInput(); } @@ -199,4 +197,4 @@ public function registerAssets() } } -} +} \ No newline at end of file