Fixed #36850 -- Prevented admin filter sidebar from wrapping below the changelist.

Removed flex-wrap from .changelist-form-container and added min-width to the
main content container to ensure proper layout behavior.
Regression in 6ea3319079.
This commit is contained in:
Nilesh Kumar Pahari
2026-01-13 00:39:48 +05:30
committed by Jacob Walls
parent c3c9f1908e
commit e92d1e3b78
4 changed files with 27 additions and 3 deletions

View File

@@ -2,7 +2,6 @@
#changelist .changelist-form-container {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
width: 100%;
}
@@ -16,6 +15,7 @@
}
#changelist .changelist-form-container:has(#changelist-filter) > div {
min-width: 0;
max-width: calc(100% - 270px);
}

View File

@@ -9,4 +9,7 @@ Django 6.0.2 fixes several bugs in 6.0.1.
Bugfixes
========
* ...
* Fixed a visual regression in Django 6.0 that caused the admin filter sidebar
to wrap below the changelist when filter elements contained long text
(:ticket:`36850`).

View File

@@ -266,7 +266,13 @@ class Person(models.Model):
(2, "Female"),
)
name = models.CharField(max_length=100)
gender = models.IntegerField(choices=GENDER_CHOICES)
gender = models.IntegerField(
choices=GENDER_CHOICES,
verbose_name=(
"very very very very very very very very very "
"loooooooooooooooooooooooooooooooooooooooooong name"
),
)
age = models.IntegerField(default=21)
alive = models.BooleanField(default=True)

View File

@@ -7205,6 +7205,21 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertTrue(show_all.is_displayed())
self.take_screenshot("pagination")
@screenshot_cases(["desktop_size", "mobile_size", "rtl", "dark", "high_contrast"])
def test_changelist_filter_sidebar_with_long_verbose_fields(self):
from selenium.webdriver.common.by import By
self.admin_login(
username="super", password="secret", login_url=reverse("admin:index")
)
Person.objects.create(name="John", gender=1)
self.selenium.get(
self.live_server_url + reverse("admin:admin_views_person_changelist")
)
changelist_filter = self.selenium.find_element(By.ID, "changelist-filter")
self.assertTrue(changelist_filter.is_displayed())
self.take_screenshot("filter_sidebar")
@override_settings(ROOT_URLCONF="admin_views.urls")
class ReadonlyTest(AdminFieldExtractionMixin, TestCase):