@@ -34,7 +34,7 @@ class Bootstrap5HorizontalRenderer extends AbstractBootstrapHorizontalRenderer
3434 '.odd ' => null ,
3535 ],
3636 'control ' => [
37- 'container ' => 'div class="col-sm- %colsControl%" ' ,
37+ 'container ' => 'div class="col-%colsControl%" ' ,
3838 '.odd ' => null ,
3939 'description ' => 'span class="form-text" ' ,
4040 'requiredsuffix ' => '' ,
@@ -56,6 +56,7 @@ class Bootstrap5HorizontalRenderer extends AbstractBootstrapHorizontalRenderer
5656 'hidden ' => [
5757 'container ' => 'div ' ,
5858 ],
59+
5960 ];
6061
6162 /**
@@ -74,7 +75,7 @@ public function render(Form $form, $mode = null): string
7475 && !($ control instanceof Controls \Checkbox)
7576 && !($ control instanceof Controls \CheckboxList)
7677 && !($ control instanceof Controls \RadioList)) {
77- $ control ->getLabelPrototype ()->addClass ($ this ->replacePlaceholders ('col-form-label col-sm- %colsLabel% ' ));
78+ $ control ->getLabelPrototype ()->addClass ($ this ->replacePlaceholders ('col-form-label col-%colsLabel% ' ));
7879 }
7980
8081 switch (true ) {
@@ -98,10 +99,14 @@ public function render(Form $form, $mode = null): string
9899 break ;
99100 case $ control instanceof Controls \CheckboxList:
100101 case $ control instanceof Controls \RadioList:
101- $ control ->getSeparatorPrototype ()->setName ('div ' )->addClass ('form-check pt-2 ' );
102+ $ control ->getContainerPrototype ()
103+ ->setName ('div ' )
104+ ->addAttributes (['class ' => 'pt-2 ' ]);
105+ $ control ->getSeparatorPrototype ()->setName ('div ' )->addClass ('form-check ' );
102106 $ control ->getControlPrototype ()->addClass ('form-check-input ' );
103107 $ control ->getLabelPrototype ()->addClass ('form-check-label ' );
104108 break ;
109+
105110 }
106111 }
107112
@@ -113,12 +118,12 @@ public function renderLabel(IControl $control): Html
113118 $ label = parent ::renderLabel ($ control );
114119
115120 if ($ control instanceof Controls \Button) {
116- $ label ->addHtml ($ this ->replacePlaceholders ('<div class="col-sm- %colsLabel%"></div> ' ));
121+ $ label ->addHtml ($ this ->replacePlaceholders ('<div class="col-%colsLabel%"></div> ' ));
117122 }
118123
119124 if ($ control instanceof Controls \Checkbox || $ control instanceof Controls \CheckboxList || $ control instanceof Controls \RadioList) {
120125 return Html::el ('div ' )
121- ->addClass ($ this ->replacePlaceholders ('col-form-label col-sm- %colsLabel% ' ))
126+ ->addClass ($ this ->replacePlaceholders ('col-form-label col-%colsLabel% ' ))
122127 ->addHtml ($ label );
123128 }
124129
0 commit comments