Opened 8 months ago

Closed 8 months ago

Last modified 3 months ago

#35386 closed Bug (fixed)

Incorrect checkbox help text alignment in multi-field rows

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

Attachments (4)

Xnapper-2024-04-16-10.31.32.png (36.3 KB ) - added by Adam Johnson 8 months ago.
single-correct
Xnapper-2024-04-16-10.31.15.png (40.7 KB ) - added by Adam Johnson 8 months ago.
double-incorrect
Xnapper-2024-04-16-10.31.01.png (39.6 KB ) - added by Adam Johnson 8 months ago.
fixed
Xnapper-2024-04-18-12.58.34.png (38.7 KB ) - added by Adam Johnson 8 months ago.
previous-dense

Download all attachments as: .zip

Change History (18)

by Adam Johnson, 8 months ago

single-correct

by Adam Johnson, 8 months ago

double-incorrect

by Adam Johnson, 8 months ago

fixed

comment:1 by Adam Johnson, 8 months ago

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

by Adam Johnson, 8 months ago

previous-dense

comment:2 by Adam Johnson, 8 months ago

I ran a bisect and confirmed this was a regression in 96a598356a9ea8c2c05b22cadc12e256a3b295fd, before which checkboxes would be densely packed:

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

comment:3 by Natalia Bidart, 8 months ago

Cc: Tom Carrick added
Triage Stage: UnreviewedAccepted
UI/UX: set

Thank you Adam, great catch!

comment:4 by Adam Johnson, 8 months ago

Version: dev4.2

comment:5 by Sarah Boyce, 8 months ago

Triage Stage: AcceptedReady for checkin

comment:6 by Sarah Boyce, 8 months ago

Triage Stage: Ready for checkinAccepted

(need to confirm if this needs backporting, if so I think this will need a release note for 4.2 and 5.0)

comment:7 by Sarah Boyce, 8 months ago

Triage Stage: AcceptedReady for checkin

comment:8 by Sarah Boyce <42296566+sarahboyce@…>, 8 months ago

Resolution: fixed
Status: assignedclosed

In bdd76c4:

Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin.

comment:9 by Sarah Boyce <42296566+sarahboyce@…>, 8 months ago

In ffcf6607:

[5.0.x] Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin.

Backport of bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16 from main.

comment:10 by Sarah Boyce <42296566+sarahboyce@…>, 8 months ago

In 0fc8326:

[4.2.x] Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin.

Backport of bdd76c4c3817d8e3ed5b0450d5e18e4eae096f16 from main.

comment:11 by Sarah Boyce <42296566+sarahboyce@…>, 8 months ago

In 256f719:

[4.2.x] Reverted "Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin."

This reverts commit 0fc832676cd585fa420d583937b5b2318bc2c629.

comment:12 by Sarah Boyce <42296566+sarahboyce@…>, 8 months ago

In a42a2fa:

[5.0.x] Reverted "Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin."

This reverts commit ffcf66071158ed3b5541ed13b4c7381240d1b310.

comment:13 by Richard Laager, 3 months ago

I noticed this was reverted in the stable branches? Was there some technical issue with the fix, or was this a policy issue (i.e. it should not have been backported to those releases per policy)?

in reply to:  13 comment:14 by Natalia Bidart, 3 months ago

Replying to Richard Laager:

I noticed this was reverted in the stable branches? Was there some technical issue with the fix, or was this a policy issue (i.e. it should not have been backported to those releases per policy)?

That's right Richard, this should not have been backported per policy. Details of that conversation are in these comments.

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