[Django] #35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form Deletion

11 views
Skip to first unread message

Django

unread,
Nov 14, 2024, 2:20:46 AM11/14/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Type: Bug
Status: new | Component:
| contrib.admin
Version: 4.2 | Severity: Normal
Keywords: inlines, | Triage Stage:
SelectFilter2, | Unreviewed
FilteredSelectMultiple |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
In the Django admin interface, when using an inline formset that includes
a FilteredSelectMultiple widget,
deleting a form causes the FilteredSelectMultiple widget below the deleted
form to become non-functional.

It appears that this issue may stem from how the id attribute index is
dynamically updated when forms are added or deleted.
The SelectFilter event listener seems to register the initial id at the
time of SelectFilter creation.
When the id changes, the event listener does not update, which causes the
filter functionality to break.


**Steps to Reproduce:**

1. Open an inline formset in the Django admin that contains a
FilteredSelectMultiple widget.
2. Delete one of the forms within the inline formset.
3. Observe that the FilteredSelectMultiple widget below the deleted form
no longer functions correctly, with the filtering feature disabled.

**Video Demonstration**: A video demonstrating this issue can be found
here.
(https://drive.google.com/file/d/17zkF5I7Cf5NMW2_qU1vroPm8ef6ukyDl/view?usp=sharing)
--
Ticket URL: <https://code.djangoproject.com/ticket/35911>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 14, 2024, 5:01:40 AM11/14/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Unreviewed => Accepted

Comment:

Replicated on main, thank you for the report!
--
Ticket URL: <https://code.djangoproject.com/ticket/35911#comment:1>

Django

unread,
Nov 14, 2024, 6:23:34 AM11/14/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by ulr0):

* cc: ulr0 (added)

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

Django

unread,
Nov 22, 2024, 4:24:21 PM11/22/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: Alanna
| Cao
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Alanna Cao):

* owner: (none) => Alanna Cao
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35911#comment:3>

Django

unread,
Dec 8, 2024, 7:29:05 PM12/8/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: Alanna
| Cao
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Alanna Cao):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35911#comment:4>

Django

unread,
Dec 17, 2024, 10:15:26 AM12/17/24
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: Alanna
| Cao
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35911#comment:5>

Django

unread,
Aug 1, 2025, 11:01:29 PM8/1/25
to django-...@googlegroups.com
#35911: FilteredSelectMultiple Widget Not Functional in Inline Formset After Form
Deletion
-------------------------------------+-------------------------------------
Reporter: ulr0 | Owner: Antoliny
Type: Bug | Status: assigned
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: inlines, | Triage Stage: Accepted
SelectFilter2, |
FilteredSelectMultiple |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Antoliny):

* owner: Alanna Cao => Antoliny

--
Ticket URL: <https://code.djangoproject.com/ticket/35911#comment:6>
Reply all
Reply to author
Forward
0 new messages