bootstrap-ruby / bootstrap_form

Official repository of the bootstrap_form gem, a Rails form builder that makes it super easy to create beautiful-looking forms using Bootstrap 5.
MIT License
1.64k stars 351 forks source link

Improve checkbox layout #686

Closed donv closed 10 months ago

donv commented 1 year ago

Since there are breaking changes, overriding the label class and indenting the check box into the second column for horizontal layout, I would like to bump the version number to 5.3 also to indicate that we now support Bootstrap 5.3.

lcreid commented 10 months ago

The edge test failures are #691

donv commented 10 months ago

@lcreid Good to merge?

donv commented 10 months ago

I'll go ahead and merge this, then.

Laykou commented 3 months ago

I've noticed this makes it difficult to add help

Previously I could do:

= f.form_group :is_requestable do
    = f.check_box :is_requestable
    .form-text
      = t('activerecord.attributes.group.is_requestable_help') 

Now I need to remove all f.form_group since the offcet is now done twice - wrapped also as part of f.check_box image

This now changed and form_group is removed (however it is still mentioned in the readme here: https://github.com/bootstrap-ruby/bootstrap_form/tree/main?tab=readme-ov-file#checkboxes-and-radios

Now it's enough to set just:

= f.check_box :is_requestable

However there is no way how to add additional text like

= f.check_box :is_requestable, help: 'Some explanatino'