From ce90e378891696b06b413dbe4b686387bb7d2df4 Mon Sep 17 00:00:00 2001 From: BigOHenry Date: Wed, 1 Nov 2017 23:13:50 +0100 Subject: [PATCH] Custom and main class can be set at the same time Custom class (set with ->setClass();) can be set at the same time with main classes (selectize form-control text). They are important to working. --- src/Selectize.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Selectize.php b/src/Selectize.php index d6dacf5..22b1320 100644 --- a/src/Selectize.php +++ b/src/Selectize.php @@ -232,7 +232,7 @@ public function getControl() 'id' => $this->getHtmlId(), 'type' => 'text', 'name' => $name, - 'class' => array(isset($this->options['class']) ? $this->options['class'] : 'selectize' . ' form-control text'), + 'class' => array(isset($this->options['class']) ? $this->options['class'] : '', 'selectize' . ' form-control text'), 'data-entity' => $this->entity, 'data-options' => $this->options, 'value' => $this->selectizeBack @@ -248,7 +248,7 @@ public function getControl() ->name($name) ->data('entity', $this->entity) ->data('options', $this->options) - ->class(isset($this->options['class']) ? $this->options['class'] : 'selectize' . ' form-control') + ->class(isset($this->options['class']) ? $this->options['class'] : '', 'selectize' . ' form-control') ->addAttributes(parent::getControl()->attrs) ->setValue($this->selectizeBack); }