Opened 7 months ago

Last modified 2 months ago

#35386 closed Bug

Incorrect checkbox help text alignment in multi-field rows — at Version 1

Reported by: Adam Johnson Owned by: Adam Johnson
Component: contrib.admin Version: 4.2
Severity: Normal Keywords:
Cc: Tom Carrick 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 Adam Johnson)

For a single checkbox, styles align the help under the checkbox:

https://code.djangoproject.com/raw-attachment/ticket/35386/Xnapper-2024-04-16-10.31.32.png

When the checkbox appears with any other field in the same line, this is undone:

https://code.djangoproject.com/raw-attachment/ticket/35386/Xnapper-2024-04-16-10.31.15.png

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:

https://code.djangoproject.com/raw-attachment/ticket/35386/Xnapper-2024-04-16-10.31.01.png

Change History (5)

by Adam Johnson, 7 months ago

single-correct

by Adam Johnson, 7 months ago

double-incorrect

by Adam Johnson, 7 months ago

fixed

comment:1 by Adam Johnson, 7 months ago

Description: modified (diff)
Has patch: set
Owner: changed from nobody to Adam Johnson
Status: newassigned

by Adam Johnson, 7 months ago

previous-dense

Note: See TracTickets for help on using tickets.
Back to Top