Handle inline radio buttons and check boxes for Bootstrap 4.#410
Handle inline radio buttons and check boxes for Bootstrap 4.#410mattbrictson merged 2 commits intobootstrap-ruby:masterfrom
Conversation
Here's an example of a CHANGELOG.md entry (place it immediately under the * [#410](https://github.com/bootstrap-ruby/bootstrap_form/pull/410): Handle inline radio buttons and check boxes for Bootstrap 4. - [@lcreid](https://github.com/lcreid).Generated by 🚫 Danger |
|
FYI you can append |
mattbrictson
left a comment
There was a problem hiding this comment.
Looks great. Nice code cleanup ✨
I do however see an issue that maybe warrants a separate issue or PR. Our documentation is not clear on how you properly create an inline form.
Some parts of the README imply that you just add layout: :inline to bootstrap_form_for and you are done. But that is either broken or the doc is wrong, because as I see in the tests, you must explicitly pass inline: true to each radio or checkbox (in addition to passing layout: :inline for the form?).
Furthermore the inline example in demo/ makes the same mistake, and the inline checkboxes there do not render nicely as a result.
I think we need to either change both the demo and the README, or our radio/check helpers need to perhaps assume inline: true if they are within a form that is layout: :inline. The latter sounds like it could be harder to get right.
|
Nice catch. I was so into just mechanically changing the existing test cases that I didn't notice that we weren't testing the case where the form has the |
|
Sounds good! If you could open the issue tomorrow I'd appreciate it. |
…ap-ruby#410) * Inline checkboxes. * Rebase from PR bootstrap-ruby#409.
The Bootstrap 4 tags for radio buttons and check boxes is more regular, so the helpers are somewhat shorter, at the cost of perhaps making the review more difficult.
If there's a way to show the diff without comparing white space, it might give you a better idea of the real changes, most notably in the test cases.
This PR partially addresses #395.