yii2-bootstrap4
yii2-bootstrap4 copied to clipboard
Custom radio|checkbox inline error
What steps will reproduce the problem?
render inline custom radiolist
What's expected?
on client validate error under list
What do you get instead?
error after last radio inside it
Additional info
| Q | A |
|---|---|
| Yii vesion | |
| PHP version | |
| Operating system |

Would you please post some code?
<?php
$model = new yii\base\DynamicModel([
'test'
]);
$model->addRule('test', 'required');
$form = yii\bootstrap4\ActiveForm::begin();
echo $form->field($model, 'test', [
'inline' => true,
])->radioList([
'' => 'Buggy',
1 => 'Y',
0 => 'N',
]);
echo \yii\bootstrap4\Html::submitButton();
yii\bootstrap4\ActiveForm::end();
also add bs4 ActiveField to return for hints like ->inline()
<?php
class ActiveForm extends \yii\widgets\ActiveForm
/**
* {@inheritdoc}
* @return \yii\widgets\ActiveField|ActiveField
*/
public function field($model, $attribute, $options = [])
{
return parent::field($model, $attribute, $options);
}
}
This is confirmed. The problem is that the error message gets appended inside the last radio element, and the layout flows it to its right.

Bootstrap 4 doesn't document inline radios & checkboxes case, so I guess it's not really supported.
Could be fixed by changing the generated markup and rolling some additional CSS..