mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-25 15:23:45 +00:00
When two date fields are in the same form, chrome ignores multiple autocomplete=off values. (#5136)
This commit is contained in:
parent
3c44037b2f
commit
7d583a52b9
5 changed files with 10 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class TestAdminDateInput(TestCase):
|
|||
|
||||
html = widget.render('test', None, attrs={'id': 'test-id'})
|
||||
|
||||
self.assertInHTML('<input type="text" name="test" autocomplete="off" id="test-id" />', html)
|
||||
self.assertInHTML('<input type="text" name="test" autocomplete="new-date" id="test-id" />', 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('<input type="text" name="test" autocomplete="off" id="test-id" />', html)
|
||||
self.assertInHTML('<input type="text" name="test" autocomplete="new-date-time" id="test-id" />', html)
|
||||
|
||||
# we should see the JS initialiser code:
|
||||
# initDateTimeChooser("test-id", {"dayOfWeekStart": 0, "format": "Y-m-d H:i"});
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -2929,7 +2929,7 @@ class TestDateBlock(TestCase):
|
|||
self.assertIn('"format": "Y-m-d"', result)
|
||||
|
||||
self.assertInHTML(
|
||||
'<input id="dateblock" name="dateblock" placeholder="" type="text" value="2015-08-13" autocomplete="off" />',
|
||||
'<input id="dateblock" name="dateblock" placeholder="" type="text" value="2015-08-13" autocomplete="new-date" />',
|
||||
result
|
||||
)
|
||||
|
||||
|
|
@ -2942,7 +2942,7 @@ class TestDateBlock(TestCase):
|
|||
self.assertIn('"dayOfWeekStart": 0', result)
|
||||
self.assertIn('"format": "d.m.Y"', result)
|
||||
self.assertInHTML(
|
||||
'<input id="dateblock" name="dateblock" placeholder="" type="text" value="13.08.2015" autocomplete="off" />',
|
||||
'<input id="dateblock" name="dateblock" placeholder="" type="text" value="13.08.2015" autocomplete="new-date" />',
|
||||
result
|
||||
)
|
||||
|
||||
|
|
@ -2958,7 +2958,7 @@ class TestDateTimeBlock(TestCase):
|
|||
result
|
||||
)
|
||||
self.assertInHTML(
|
||||
'<input id="datetimeblock" name="datetimeblock" placeholder="" type="text" value="13.08.2015 10:00" autocomplete="off" />',
|
||||
'<input id="datetimeblock" name="datetimeblock" placeholder="" type="text" value="13.08.2015 10:00" autocomplete="new-date-time" />',
|
||||
result
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue