-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Fixed #35911 -- FilteredSelectMultiple Widget Not Functional in Inline Formset After Form Deletion #18903
base: main
Are you sure you want to change the base?
Conversation
… causes filter to reset
…mpleted and passing test case for new filtered select functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for your contribution 💪
As it's your first contribution be sure to check out the patch review checklist.
If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
There are a same issue already exists in select2 (autocomplete in inline formset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you resolve the test and linter failures before putting this back in the review queue ⭐
@@ -1,63 +1,17 @@ | |||
import globals from "globals"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert these changes
venv/ | ||
.venv/ | ||
env/ | ||
.env/ | ||
myproject/staticfiles | ||
myproject/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert these changes
|
||
// document.addEventListener('formset:added', function(e) { | ||
// const formId = e.target.id; // Get the form ID | ||
// const newField = formId.querySelector('select.selectfilter'); | ||
// if (newField) { | ||
// const fieldName = newField.dataset.fieldName; | ||
// const isStacked = parseInt(newField.dataset.isStacked, 10); | ||
// SelectFilter.init(newField.id, fieldName, isStacked); | ||
// } | ||
// }); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try not to comment out blocks of code. If this is not needed, it should be removed
Trac ticket number: 35911
ticket-35911
Branch description
This PR addressed the issue where the FilteredSelectMultiple widget became non-functional when inline formsets in Django admin were dynamically deleted. The widget's icons and dropdown filters failed to refresh correctly, and event handlers were not reinitialized, causing usability issues.
The implemented solution focused on improving the handling of icons and dropdown filters. The key changes included:
Checklist
main
branch.