#32623: Collapsible fieldsets inside inlines do not work -----------------------------------------------+------------------------ Reporter: Matthias Kestenholz | Owner: nobody Type: Bug | Status: new Component: contrib.admin | Version: 3.2 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | -----------------------------------------------+------------------------ When using a stacked inline with `fieldsets = [(..., {"classes": ["collapse"]})]` the expected behavior would be that the Show/Hide functionality works not only in existing inlines but also in inlines which have been dynamically added via the "add another" button.
This isn't the case currently. The reason for this is (probably) that the event listener is only attached to `<fieldset class="module">` elements existing at page load. Replacing the code here https://github.com/django/django/blob/45a58c31e64dbfdecab1178b1d00a3803a90ea2d/django/contrib/admin/static/admin/js/collapse.js#L39-L41 with `document.body.addEventListener("click", toggleFunc)` _may_ be a sufficient fix but I haven't tested this. This should be relatively easy (famous last words) and I hope it's a good start for someone to start submitting patches to Django :-) -- Ticket URL: <https://code.djangoproject.com/ticket/32623> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.ea04ea7cfcbcf1a8e410592b21f3cb26%40djangoproject.com.