bootstrap_form icon indicating copy to clipboard operation
bootstrap_form copied to clipboard

Bootstrap 4 Custom Controls

Open lcreid opened this issue 7 years ago • 1 comments
trafficstars

Bootstrap 4 provides four custom controls (https://getbootstrap.com/docs/4.0/components/forms/#custom-forms):

  • input type="radio"
  • input type="checkbox"
  • select
  • input type="file"

The state of bootstrap_form v4.0 at the time of writing is:

  • v2.7 of bootstrap_form has a custom option on radio_button and check_box that uses the Bootstrap 3 custom controls, and that functionality was carried forward to V4.0.
  • I believe PR #439 makes file_field use the custom control.
  • There is no custom select

It looks like making a custom select with Bootstrap 4 is as simple as adding custom-select to the select tag's classes. I think it would be nice to implement a custom argument to add the class to the select. The alternative would be to document in the read me how to add the class. Whatever way it's done, we should do test cases and check the rendering in the demo app, or Bootply.

The above would also apply to collection_select and grouped_collection_select.

As mentioned, we already do the custom file_field, so we just have to add the custom option and make it turn on and off the custom formatting.

Perhaps worth mentioning is that .input-groups are only supported for custom selects and input type="file". By implementing an explicit option, we could actually check and notify programmers if they don't specify the right combination of options.

lcreid avatar Mar 16 '18 19:03 lcreid

Also see #428. Currently collection_select and grouped_collection_select don't get :prepend and :append anyway, but maybe that should change.

lcreid avatar Mar 16 '18 19:03 lcreid

Support for Bootstrap 4 has been dropped, and Bootstrap 5 does not have separate custom controls.

donv avatar Sep 08 '23 12:09 donv