Opened 18 months ago
Last modified 8 weeks ago
#34624 assigned Bug
RelatedFieldWidgetWrapper links toggling isn’t working for radio widgets — at Initial Version
Reported by: | Thibaud Colas | Owned by: | Coen van der Kamp |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
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.
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.