#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>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018ef10b2b3a-6c841b35-6692-44b9-b3cf-6223855d2390-000000%40eu-central-1.amazonses.com.