Opened 6 weeks ago

Last modified 6 weeks ago

#36513 assigned Bug

Background color for admin's m2m multi-select "selected" rows is broken in Edge

Reported by: cjs59 Owned by: Forrest Roudebush
Component: contrib.admin Version: 5.2
Severity: Normal Keywords: accessibility
Cc: Antoliny Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description (last modified by Antoliny)

The change in https://code.djangoproject.com/ticket/35809 has made the selected item hard to read in Microsoft Edge, as it displays as white text on a yellow background when the m2m widget is not in focus. Chrome and Firefox both display it as black text on a yellow background. When the user clicks on the m2m widget, it changes to use the browser's built-in colours: white text on dark grey for Edge, and white text on blue for Chrome/Firefox.

I am attaching screenshots to show the focused and unfocused colours in both Edge and Chrome.

Adding the following to a custom CSS file fixes Edge so the unfocused widget renders the same as in Chrome:

form .aligned select option:checked {
        color: var(--body-fg);
}

Chrome focused


Chrome unfocused


Edge focused


Edge unfocused


Edge focused(dark)


Edge unfocused(dark)


Attachments (6)

Chrome-focused.png (11.7 KB ) - added by cjs59 6 weeks ago.
Chrome-unfocused.png (10.8 KB ) - added by cjs59 6 weeks ago.
Edge-focused.png (11.2 KB ) - added by cjs59 6 weeks ago.
Edge-unfocused.png (9.4 KB ) - added by cjs59 6 weeks ago.
Screenshot 2025-07-21 at 7.43.04 AM.png (41.6 KB ) - added by Antoliny 6 weeks ago.
Screenshot 2025-07-21 at 7.43.10 AM.png (44.1 KB ) - added by Antoliny 6 weeks ago.

Download all attachments as: .zip

Change History (18)

by cjs59, 6 weeks ago

Attachment: Chrome-focused.png added

by cjs59, 6 weeks ago

Attachment: Chrome-unfocused.png added

by cjs59, 6 weeks ago

Attachment: Edge-focused.png added

by cjs59, 6 weeks ago

Attachment: Edge-unfocused.png added

comment:1 by cjs59, 6 weeks ago

Description: modified (diff)

comment:2 by Antoliny, 6 weeks ago

Component: Uncategorizedcontrib.admin
Keywords: accessibility added
Triage Stage: UnreviewedAccepted

comment:3 by Antoliny, 6 weeks ago

Thank you for submitting the ticket.
I have replicated the issue. In the Edge browser, after clicking the m2m select button and the widget loses focus, the text color in light mode is hex: ffffff (white), resulting in a contrast ratio of 1.03 against the background color, which does not meet the WCAG AA criteria.
In dark mode, the text color is hex: 161616 (black), with a contrast ratio of 1.37 against the background, which also fails to meet the AA criteria, just like in light mode.

I think we could resolve the issue by setting a fixed text color :)

comment:4 by Antoliny, 6 weeks ago

Description: modified (diff)

comment:5 by Antoliny, 6 weeks ago

Description: modified (diff)

comment:6 by Antoliny, 6 weeks ago

Cc: Antoliny added

comment:7 by Chaitanya, 6 weeks ago

form .aligned select option:checked {
        color: var(--body-fg);
}

applying this change is fixing the issue, but are there any other things that need to be addressed...

in reply to:  7 comment:8 by Antoliny, 6 weeks ago

Replying to Chaitanya:

form .aligned select option:checked {
        color: var(--body-fg);
}

applying this change is fixing the issue, but are there any other things that need to be addressed...

I need to test it to be sure, but from what I can see, adding just the color should fix the issue.

comment:9 by Antoliny, 6 weeks ago

Easy pickings: set

comment:10 by Forrest Roudebush, 6 weeks ago

Owner: set to Forrest Roudebush
Status: newassigned

comment:11 by Forrest Roudebush, 6 weeks ago

Has patch: set

comment:12 by Sarah Boyce, 6 weeks ago

Patch needs improvement: set
Note: See TracTickets for help on using tickets.
Back to Top