Opened 3 years ago
Last modified 3 months ago
#34624 closed Bug
RelatedFieldWidgetWrapper links toggling isn’t working for radio widgets — at Version 2
| Reported by: | Thibaud Colas | Owned by: | Coen van der Kamp |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description (last modified by )
Spotted as part of #34622. In the Redirects contrib module, when creating a new redirect, the first field is for a Site instance. This is using a radio button (radio_fields ModelAdmin definition: https://github.com/django/django/blob/main/django/contrib/redirects/admin.py#L10). This uses RelatedFieldWidgetWrapper – which doesn’t work for radio widgets. Demo:
If we look at RelatedObjectLookups.js, it seems clear this code was only written to support select widgets.
Tagging this contrib.admin because it seems to affect all usage of RelatedFieldWidgetWrapper – but as far as I can see in Django itself only contrib.redirects uses radio_fields.
---
In this instance I believe a select widget would be a much nicer experience anyway, so not entirely sure whether it makes sense to change the widget to fix this, or update the code to support radio buttons, or do both.
Change History (3)
by , 3 years ago
| Attachment: | related-links.gif added |
|---|
comment:1 by , 3 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 3 years ago
| Description: | modified (diff) |
|---|
