Fixed #32091 -- Fixed admin search bar width on filtered admin page.

This commit is contained in:
Tim Schilling 2020-10-08 14:44:34 -05:00 committed by Mariusz Felisiak
parent de81676b51
commit b7da588e88
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 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

@ -4931,6 +4931,17 @@ class SeleniumTests(AdminSeleniumTestCase):
['Roboto', 'Lucida Grande', 'Verdana', 'Arial', 'sans-serif'],
)
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):