[3.1.x] Fixed #32091 -- Fixed admin search bar width on filtered admin page.

Backport of b7da588e88 from master
This commit is contained in:
Tim Schilling 2020-10-08 14:44:34 -05:00 committed by Mariusz Felisiak
parent 8c403b17f9
commit 4047c1602c
3 changed files with 16 additions and 1 deletions

View File

@ -120,7 +120,8 @@ input[type="submit"], button {
}
#changelist-search .quiet {
width: 100%;
width: 0;
flex: 1 0 auto;
margin: 5px 0 0 25px;
}

View File

@ -12,6 +12,9 @@ Bugfixes
* Fixed a regression in Django 3.1.2 that caused the incorrect height of the
admin changelist search bar (:ticket:`32072`).
* Fixed a regression in Django 3.1.2 that caused the incorrect width of the
admin changelist search bar on a filtered admin page (:ticket:`32091`).
* Fixed displaying Unicode characters in
:class:`forms.JSONField <django.forms.JSONField>` and read-only
:class:`models.JSONField <django.db.models.JSONField>` values in the admin

View File

@ -4813,6 +4813,17 @@ class SeleniumTests(AdminSeleniumTestCase):
value = self.selenium.find_element_by_id('id_form-0-parent').get_attribute('value')
self.assertEqual(value, str(parent2.pk))
def test_search_input_filtered_page(self):
Person.objects.create(name='Guido van Rossum', gender=1, alive=True)
Person.objects.create(name='Grace Hopper', gender=1, alive=False)
self.admin_login(username='super', password='secret', login_url=reverse('admin:index'))
person_url = reverse('admin:admin_views_person_changelist') + '?q=Gui'
self.selenium.get(self.live_server_url + person_url)
self.assertGreater(
self.selenium.find_element_by_id('searchbar').rect['width'],
50,
)
@override_settings(ROOT_URLCONF='admin_views.urls')
class ReadonlyTest(AdminFieldExtractionMixin, TestCase):