Skip to content

Fixed #36513 -- M2M multi-select background color. #19674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

forrrestr
Copy link

@forrrestr forrrestr commented Jul 25, 2025

Trac ticket number

ticket-36513

Branch description

Updated the background color of M2M multi-select to be more visible in Edge.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

background-color: var(--selected-row);
background-color: var(--body-fg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is resolved in the Edge browser with the applied color for the selected option, but the same issue occurs in other browsers.

For reference, the color you selected causes an issue as a foreground color.

Edge

Screenshot 2025-07-25 at 4 22 22 PM

Firefox

Screenshot 2025-07-25 at 4 22 56 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we can make the text color consistent between browsers, that would be better than chosing a new background color 👍
@forrrestr I recommend you add screenshots to your PR (as stated in the PR description) to make this easier to review 👍

Copy link
Contributor

@Antoliny0919 Antoliny0919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for picking up this ticket @forrrestr ⭐️.

In my opinion, it might be better to fix the issue by explicitly setting the text color with CSS.

like this...

index 307d9e9d86..ec213e1004 100644
--- a/django/contrib/admin/static/admin/css/forms.css
+++ b/django/contrib/admin/static/admin/css/forms.css
@@ -170,7 +170,8 @@ form .aligned select + div.help {
 }
 form .aligned select option:checked {
-    background-color: var(--body-fg);
+    background-color: var(--selected-row);
+    color: var(--body-fg);
 }

It may also be a good idea to include a visual regression test.

@Antoliny0919
Copy link
Contributor

It seems the ticket link in the main text is incorrect.
I would appreciate it if you could also fix this.

Comment on lines +15 to +17

* Fixed Background color for admin's m2m multi-select "selected" rows in Edge
(:ticket: `36513`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fixed Background color for admin's m2m multi-select "selected" rows in Edge
(:ticket: `36513`)

As this is not a release blocker, we do not need a release note in Django 5.2.5

@sarahboyce sarahboyce added selenium Apply to have Selenium tests run on a PR screenshots 🖼️ labels Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
screenshots 🖼️ selenium Apply to have Selenium tests run on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants