#35386: Incorrect checkbox help text alignment in multi-field rows
-------------------------------+----------------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Adam Johnson):
* has_patch: 0 => 1
* owner: nobody => Adam Johnson
* status: new => assigned
Old description:
> For a single checkbox, styles align the help under the checkbox:
>
> ...
>
> When the checkbox appears with any other field in the same line, this is
> undone:
>
> ...
>
> Example admin:
>
> {{{
> from django.contrib import admin
> from example.models import Switcher
>
> class SwitcherAdmin(admin.ModelAdmin):
> fieldsets = [
> (
> None,
> {
> "fields": [
> ("up", "down"),
> ],
> },
> ),
> ]
>
> admin.site.register(Switcher, SwitcherAdmin)
> }}}
>
> (It doesn’t matter if the other field is a checkbox or not.)
New description:
For a single checkbox, styles align the help under the checkbox:
[[Image(
https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.32.png, 558px)]]
When the checkbox appears with any other field in the same line, this is
undone:
[[Image(
https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.15.png, 592px)]]
Example admin:
{{{
from django.contrib import admin
from example.models import Switcher
class SwitcherAdmin(admin.ModelAdmin):
fieldsets = [
(
None,
{
"fields": [
("up", "down"),
],
},
),
]
admin.site.register(Switcher, SwitcherAdmin)
}}}
(It doesn’t matter if the other field is a checkbox or not.)
Changing `fieldset.html` so `checkbox-row` is applied unconditionally to
checkbox-containing field boxes fixes this regression, plus #34994:
[[Image(
https://code.djangoproject.com/raw-
attachment/ticket/35386/Xnapper-2024-04-16-10.31.01.png, 562px)]]
--
--
Ticket URL: <
https://code.djangoproject.com/ticket/35386#comment:1>