django-crispy-forms / crispy-bootstrap4

Bootstrap 4 template pack for django-crispy-forms
MIT License
11 stars 5 forks source link

Accordion and AccordionGroup ignore css_class attribute #27

Closed kosdmit closed 2 months ago

kosdmit commented 4 months ago

the same issue as in crispy-bootstrap5: https://github.com/django-crispy-forms/crispy-bootstrap5/issues/168

this layout:

test_form.helper.layout = Layout(
    Accordion(
        AccordionGroup("one", "first_name", css_class="one two three"),
        css_class="four five",
    )
)

renders html which does not include css_class strings:

<form method="post">
  <div id="accordion-9683" role="tablist">
    <div class="card mb-2">
      <div class="card-header" role="tab">
        <h5 class="mb-0">
          <a data-toggle="collapse" href="#one" aria-expanded="true" aria-controls="one">one</a>
        </h5>
      </div>
      <div id="one" class="collapse show" role="tabpanel" aria-labelledby="one" data-parent="#accordion-9683">
        <div class="card-body">
          <div id="div_id_first_name" class="form-group">
            <label for="id_first_name" class=" requiredField">first name<span class="asteriskField">*</span> </label>
            <div>
              <input type="text" name="first_name" maxlength="5" class="textinput textInput inputtext form-control" required id="id_first_name">
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</form>