Skip to content

Conversation

@donv
Copy link
Collaborator

@donv donv commented Jun 18, 2023

  • Indent checkbox into second column for horizontal layout
  • Allow overriding the label class, not just add more classes.
  • Align label with the top of the first check box in a collection in horizontal layout
  • Vertically align check boxes and labels in inline layout.

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.

@donv donv requested a review from lcreid June 18, 2023 07:31
@donv donv self-assigned this Jun 18, 2023
Copy link
Contributor

@lcreid lcreid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I share your concern about these being breaking changes, but since we're really fixing stuff that was broken before (mis-aligned fields and labels, for example), I think making the change is reasonable.

I'd like to see what you think about my comments and questions before I approve, but overall I really like what I'm seeing.

@donv donv force-pushed the better_checkbox_layout branch from 723cbb9 to 0808baa Compare August 14, 2023 13:54
@lcreid
Copy link
Contributor

lcreid commented Aug 15, 2023

The edge test failures are #691

@donv donv force-pushed the better_checkbox_layout branch from 7437dc9 to 0bb953e Compare August 15, 2023 10:17
Indent checkbox into second column for horizontal layout. Override with layout: :default Align label with the top of the first check box in a collection in horizontal layout Vertically align check boxes and labels in inline layout. Allow overriding the label class, not just add more classes. Avoid duplicate form label classes.
@donv donv force-pushed the better_checkbox_layout branch from 0bb953e to 36cf712 Compare August 15, 2023 10:50
@donv
Copy link
Collaborator Author

donv commented Aug 16, 2023

@lcreid Good to merge?

@donv
Copy link
Collaborator Author

donv commented Aug 17, 2023

I'll go ahead and merge this, then.

@donv donv merged commit 23dd6d4 into main Aug 17, 2023
@donv donv deleted the better_checkbox_layout branch August 17, 2023 07:03
@Laykou
Copy link

Laykou commented Apr 3, 2024

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' 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants