-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render Bootstrap 4 Radio Buttons and Check Boxes #407
Conversation
Here's an example of a CHANGELOG.md entry (place it immediately under the * [#407](https://github.com/bootstrap-ruby/bootstrap_form/pull/407): Render Bootstrap 4 Radio Buttons and Check Boxes - [@lcreid](https://github.com/lcreid). Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks good to me. I will start using it in my apps as soon as it is merged.
The general checkbox case looks good, but I am seeing a couple minor discrepancies otherwise. The Bootstrap v4 docs say that radios should be wrapped in Also, for disabled checkboxes, the docs say the wrapper should be |
Also: It looks like inline checkboxes might need a separate PR? |
OK. I need to step up my game on reading the Bootstrap docs. Now that I'm starting to do that, I see that radio buttons should also have class It also looks like I should be handling the "no label" case explicitly: https://getbootstrap.com/docs/4.0/components/forms/#without-labels. I think I'll do that in a separate PR. @mattbrictson what did you mean by inline checkboxes needing a separate PR? Is it because both radio and check boxes inline are rendered differently compared to Bootstrap 3, and therefore the changes are more extensive? I will finish implementing the two fixes @mattbrictson mentioned in his comment just above and await answers to some of these questions. |
Needed to use `disabled="disabled"` form of attribute for Nokogiri and/or EquivalentXML.
This seems to show that radio button |
I pushed fixes for #407 (comment) to this PR. I will open other PRs to address each of:
|
I have code ready to go for PRs for correcting the classes on radio button elements, and for doing inline radios and checkboxes. @mattbrictson I appreciate that the more changes you have to look at, the harder the review, but... If I add the code to finish the radio button classes to this PR, it will be easier for you to reconcile the Bootstrap docs with the PR. Your call whether I add more to this PR or not. I'll wait until we merge this PR before I push the PR for inline elements. |
This looks good to merge, thanks! 💯 I'm fine with handling the remaining cases as separate PRs. |
Bootstrap 4 no longer wraps radio buttons and check boxes inside the label. Previously it was:
Where it should be:
I really couldn't see any sensible way to change the rendering without doing a little bit of simplifying of the code in the
radio_button_with_bootstrap
andcheck_box_with_bootstrap
helpers. I suspect more refactoring/simplification could be done in those methods, but I thought now is not the time to do that.I would appreciate it if someone who's a little more knowledgeable about Bootstrap 4, makes sure that I changed the test cases correctly.