diff --git a/CHANGES.md b/CHANGES.md index e5d296ab..4c39da5f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ ### Fixed -* +* Fix repeatable_attr_input for Bootstrap 5.x. https://github.com/sciencehistory/kithe/pull/183 * diff --git a/app/simple_form_enhancements/kithe/repeatable_input_generator.rb b/app/simple_form_enhancements/kithe/repeatable_input_generator.rb index 5b6eb41e..d77c4640 100644 --- a/app/simple_form_enhancements/kithe/repeatable_input_generator.rb +++ b/app/simple_form_enhancements/kithe/repeatable_input_generator.rb @@ -175,8 +175,11 @@ def repeatable_thing_class # Wraps with the proper DOM for cocooon JS, along with the remove button. # @yield pass block with content to wrap def wrap_with_repeatable_ui - # cocoon JS wants "nested-fields" - template.content_tag(:div, class: "nested-fields form-row") do + # * cocoon JS wants "nested-fields" + # * 'row' and `g-3 are for bootstrap 5 -- but doens't mess up bootstrap 4 because + # conveniently the 'form-row' ends up taking precedence. + # * form-row is for bootstrap 4. Doesn't exist in bootstrap 5. + template.content_tag(:div, class: "nested-fields form-row row g-3") do template.content_tag(:div, class: "col") do yield end +