This commit is contained in:
Simon Karlen 2021-10-12 12:34:14 +02:00
parent 02fbdf84d8
commit 6789d54cb3
No known key found for this signature in database
GPG Key ID: 0630C27D666EBCC3
3 changed files with 11 additions and 10 deletions

View File

@ -4,6 +4,7 @@ Yii Framework 2 bootstrap5 extension Change Log
2.0.2 under development
-----------------------
- Bug #15: Fixed inline rendering of checkboxLists and radioLists (simialbi)
- Bug #5: BootstrapWidgetTrait::registerPlugin do nothing if no clientOptions is provided (dicrtarasov)
- Enh #11: Brought back close button api (simialbi)
- Bug #6: yii\bootstrap5\BaseHtml::staticControl(): Argument #1 ($value) must be of type string, int given (dicrtarasov)

View File

@ -341,9 +341,9 @@ class ActiveField extends \yii\widgets\ActiveField
'value' => $value,
], $itemOptions);
$wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', ['class' => ['form-check']]);
// if ($this->inline) {
// Html::addCssClass($wrapperOptions, 'custom-control-inline');
// }
if ($this->inline) {
Html::addCssClass($wrapperOptions, 'form-check-inline');
}
$html = Html::beginTag('div', $wrapperOptions) . "\n" .
Html::checkbox($name, $checked, $options) . "\n";
@ -383,9 +383,9 @@ class ActiveField extends \yii\widgets\ActiveField
'value' => $value,
], $itemOptions);
$wrapperOptions = ArrayHelper::remove($options, 'wrapperOptions', ['class' => ['form-check']]);
// if ($this->inline) {
// Html::addCssClass($wrapperOptions, 'custom-control-inline');
// }
if ($this->inline) {
Html::addCssClass($wrapperOptions, 'form-check-inline');
}
$html = Html::beginTag('div', $wrapperOptions) . "\n" .
Html::radio($name, $checked, $options) . "\n";

View File

@ -194,12 +194,12 @@ HTML;
$expectedHtml = <<<HTML
<div class="mb-3 field-dynamicmodel-attributename">
<label class="form-label">Attribute Name</label>
<input type="hidden" name="DynamicModel[attributeName]" value=""><div id="dynamicmodel-attributename" role="radiogroup"><div class="form-check">
<input type="hidden" name="DynamicModel[attributeName]" value=""><div id="dynamicmodel-attributename" role="radiogroup"><div class="form-check form-check-inline">
<input type="radio" id="i0" class="form-check-input" name="DynamicModel[attributeName]" value="1">
<label class="form-check-label" for="i0">name1</label>
</div>
<div class="form-check">
<div class="form-check form-check-inline">
<input type="radio" id="i1" class="form-check-input" name="DynamicModel[attributeName]" value="2">
<label class="form-check-label" for="i1">name2</label>
<div class="invalid-feedback"></div>
@ -220,12 +220,12 @@ HTML;
$expectedHtml = <<<HTML
<div class="mb-3 field-dynamicmodel-attributename">
<label class="form-label">Attribute Name</label>
<input type="hidden" name="DynamicModel[attributeName]" value=""><div id="dynamicmodel-attributename"><div class="form-check">
<input type="hidden" name="DynamicModel[attributeName]" value=""><div id="dynamicmodel-attributename"><div class="form-check form-check-inline">
<input type="checkbox" id="i0" class="form-check-input" name="DynamicModel[attributeName][]" value="1">
<label class="form-check-label" for="i0">name1</label>
</div>
<div class="form-check">
<div class="form-check form-check-inline">
<input type="checkbox" id="i1" class="form-check-input" name="DynamicModel[attributeName][]" value="2">
<label class="form-check-label" for="i1">name2</label>
<div class="invalid-feedback"></div>