-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add missing css_class to accordion and accordion-group templates #180
Conversation
Thanks for the PR! Just one comment on about this:
Is this the case with Bootstrap 5? I can't see any reference to this class in their docs and trying it locally seems to indicate there are no styles for that class? |
You are right, that is my mistake, bootstrap 5 does not use 'active' class. class Container(Div):
def render(self, form, context, template_pack=TEMPLATE_PACK, **kwargs):
if self.active:
if "active" not in self.css_class:
self.css_class += " active"
else:
self.css_class = self.css_class.replace("active", "")
return super().render(form, context, template_pack) I think it's would right to add a separate attr to define activity of item, and do not add this class to css_class string. What do you think? |
I was wondering where this was actually required, seems that it is for tabs rather than accordion. Maybe we should move |
Hi @smithdc1, I've done some work to close that issue in this template pack:
|
Could you add an entry to the changelog? |
Thank you! 🥇 |
This PR is based on PR #169, and it completely resolves issue #168 .
I've fixed accordion.html and accordion-group.html templates and written a few tests for checking css_classes is rendered correctly.
I've also fix some tests templates, because the first accordion item should have css_class 'active' by default (look comment in issue for details.