yii2-bootstrap5
yii2-bootstrap5 copied to clipboard
ActiveForm | Incorrect radioList HTML/CSS
Incorrect HTML/CSS when rendering radioList field (ActiveForm) using LAYOUT_FLOATING
What steps will reproduce the problem?
use yii\bootstrap5\ActiveForm;
$form = ActiveForm::begin([
'layout' => ActiveForm::LAYOUT_FLOATING,
]);
// text fields are rendered as expected
echo $form->field($model, 'from')->textInput(['autocomplete' => 'off', 'type' => 'date']);
echo $form->field($model, 'to')->textInput(['autocomplete' => 'off', 'type' => 'date']);
// radio list field shows incorrect HTML as a result of using LAYOUT_FLOATING
echo $form->field($model, 'status')->radioList([0 => 'Inactive', 1 => 'Active']);
ActiveForm::end();
What is the expected result?
A normal stacked radio list with label on top https://getbootstrap.com/docs/5.3/forms/checks-radios/#default-stacked

What do you get instead?
Stacked radio list but the label is rendered incorrectly inside the list:

Additional info
| Q | A |
|---|---|
| Yii vesion | 2.0.47 (advanced template) |
| PHP version | 8.1.2 |
| Operating system | Ubuntu 22.04.1 LTS |
| yiisoft/yii2-bootstrap5 | 2.0.4 |