diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 456e73436..a54822c93 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -38,6 +38,7 @@ Changelog * Fix: Inform user when moving a page from one parent to another where there is an already existing page with the same slug (Casper Timmers) * Fix: User add/edit forms now support form widgets with JS/CSS media (Damian Grinwis) * Fix: Rich text processing now preserves non-breaking spaces instead of converting them to normal spaces (Wesley van Lee) + * Fix: Prevent autocomplete dropdowns from appearing over date choosers on Chrome (Kevin Howbrook) 2.4 (19.12.2018) diff --git a/docs/releases/2.5.rst b/docs/releases/2.5.rst index fe40e469f..ec0c23426 100644 --- a/docs/releases/2.5.rst +++ b/docs/releases/2.5.rst @@ -54,6 +54,7 @@ Bug fixes * Inform user when moving a page from one parent to another where there is an already existing page with the same slug (Casper Timmers) * User add/edit forms now support form widgets with JS/CSS media (Damian Grinwis) * Rich text processing now preserves non-breaking spaces instead of converting them to normal spaces (Wesley van Lee) + * Prevent autocomplete dropdowns from appearing over date choosers on Chrome (Kevin Howbrook) Upgrade considerations diff --git a/wagtail/admin/tests/test_widgets.py b/wagtail/admin/tests/test_widgets.py index a0d14a7ac..aca71d283 100644 --- a/wagtail/admin/tests/test_widgets.py +++ b/wagtail/admin/tests/test_widgets.py @@ -94,7 +94,7 @@ class TestAdminDateInput(TestCase): html = widget.render('test', None, attrs={'id': 'test-id'}) - self.assertInHTML('', html) + self.assertInHTML('', html) # we should see the JS initialiser code: # initDateChooser("test-id", {"dayOfWeekStart": 0, "format": "Y-m-d"}); @@ -130,7 +130,7 @@ class TestAdminDateTimeInput(TestCase): html = widget.render('test', None, attrs={'id': 'test-id'}) - self.assertInHTML('', html) + self.assertInHTML('', html) # we should see the JS initialiser code: # initDateTimeChooser("test-id", {"dayOfWeekStart": 0, "format": "Y-m-d H:i"}); diff --git a/wagtail/admin/widgets.py b/wagtail/admin/widgets.py index 3b0b8acfa..794cae430 100644 --- a/wagtail/admin/widgets.py +++ b/wagtail/admin/widgets.py @@ -38,7 +38,7 @@ class AdminDateInput(widgets.DateInput): template_name = 'wagtailadmin/widgets/date_input.html' def __init__(self, attrs=None, format=None): - default_attrs = {'autocomplete': 'off'} + default_attrs = {'autocomplete': 'new-date'} fmt = format if attrs: default_attrs.update(attrs) @@ -63,7 +63,7 @@ class AdminTimeInput(widgets.TimeInput): template_name = 'wagtailadmin/widgets/time_input.html' def __init__(self, attrs=None, format='%H:%M'): - default_attrs = {'autocomplete': 'off'} + default_attrs = {'autocomplete': 'new-time'} if attrs: default_attrs.update(attrs) super().__init__(attrs=default_attrs, format=format) @@ -73,7 +73,7 @@ class AdminDateTimeInput(widgets.DateTimeInput): template_name = 'wagtailadmin/widgets/datetime_input.html' def __init__(self, attrs=None, format=None): - default_attrs = {'autocomplete': 'off'} + default_attrs = {'autocomplete': 'new-date-time'} fmt = format if attrs: default_attrs.update(attrs) diff --git a/wagtail/core/tests/test_blocks.py b/wagtail/core/tests/test_blocks.py index 2dafc6086..a708d9065 100644 --- a/wagtail/core/tests/test_blocks.py +++ b/wagtail/core/tests/test_blocks.py @@ -2929,7 +2929,7 @@ class TestDateBlock(TestCase): self.assertIn('"format": "Y-m-d"', result) self.assertInHTML( - '', + '', result ) @@ -2942,7 +2942,7 @@ class TestDateBlock(TestCase): self.assertIn('"dayOfWeekStart": 0', result) self.assertIn('"format": "d.m.Y"', result) self.assertInHTML( - '', + '', result ) @@ -2958,7 +2958,7 @@ class TestDateTimeBlock(TestCase): result ) self.assertInHTML( - '', + '', result )