Closed denis-sanches closed 3 years ago
It's because custom controls are used by default in yii\bootstrap4\ActiveForm
and ::before and ::after are used to display the custom control.
You can ovveride the template to use default checkboxes like this (untested)
<?= $form->field($model, 'ativo', [
'checkTemplate' => "{label}\n{input}\n{error}\n{hint}"
])->checkbox() ?>
Hi, @simialbi. Thank you!!
I've tried overring the template but with no success. In fact, this CSS seems to work to all cases in BS4, even radio():
div.required > label::after, div.required > .custom-control::after {
content: " *";
color: red;
}
Again, thank you so much!
What steps will reproduce the problem?
CSS:
views/usuario/_form.php (raw/example):
What's expected?
Append the red * after the label text for required fields as using the default
yii\widgets\ActiveForm
as follows:What do you get instead?
It's overlapping the dropbox, "appending" the label::after before the label, as follows (just changing the above PHP code to
use yii\bootstrap4\ActiveForm;
instead)Additional info
It's my first time contributing here... and CSS is not my field. I've tried some minimal changes to this getting working without having to pass a template option but with no success. If that's not a bug and just a code configuration problem, my apologies in advance. Ah... the same occurs with ->radio();