[Django] #32623: Collapsible fieldsets inside inlines do not work

1 view
Skip to first unread message

Django

unread,
Apr 8, 2021, 3:10:14 PM4/8/21
to django-...@googlegroups.com
#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.

Django

unread,
Apr 9, 2021, 12:55:34 AM4/9/21
to django-...@googlegroups.com
#32623: Collapsible fieldsets inside inlines do not work
-------------------------------------+-------------------------------------

Reporter: Matthias Kestenholz | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
| worksforme

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => worksforme


Comment:

Thanks for the report, however it works for me (see also #30459 and a test
added in e286987a27271c8ee7eb6e4d4332b563c4e6094b).

--
Ticket URL: <https://code.djangoproject.com/ticket/32623#comment:1>

Django

unread,
Apr 9, 2021, 2:09:07 AM4/9/21
to django-...@googlegroups.com
#32623: Collapsible fieldsets inside inlines do not work
-------------------------------------+-------------------------------------

Reporter: Matthias Kestenholz | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
| worksforme

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Matthias Kestenholz):

Oh no, you're right. Sorry for not checking two or three times before
submitting this report!

--
Ticket URL: <https://code.djangoproject.com/ticket/32623#comment:2>

Reply all
Reply to author
Forward
0 new messages