yiisoft/yii2-bootstrap5

Inline parameter is ignored in checkboxList and radioList

Renkas opened this issue · 1 comments

These lines should be changed:

$wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', ['class' => ['form-check']]);

$wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', ['class' => ['form-check']]);

From this:

                $wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', ['class' => ['form-check']]);

To this:

                $wrapperOptionsDefault =  ['class' => ['form-check']];
                if ($this->inline) {
                    Html::addCssClass($wrapperOptionsDefault, 'form-check-inline');
                }
                $wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', $wrapperOptionsDefault);

Sorry I don't have the time to create a pull request at this time myself.

Why did you implement it that way? Instead of the example I gave here? Your implementation does not give user the possibility to use their own classes exclusively. It will always add default form-check-inline when using inline.