diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cc75380595..5e374cf94b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -46,6 +46,7 @@ Changelog * Fix: Redirects no longer fail when both a site-specific and generic redirect exist for the same URL path (Nick Smith, João Luiz Lorencetti) * Fix: Wagtail now checks that Group is registered with the Django admin before unregistering it (Jason Morrison) * Fix: Previewing inaccessible pages no longer fails with `ALLOWED_HOSTS = ['*']` (Robert Rollins) + * Fix: The submit button 'spinner' no longer activates if the form has client-side validation errors (Jack Paine, Matt Westcott) 1.4.3 (04.04.2016) diff --git a/docs/releases/1.4.4.rst b/docs/releases/1.4.4.rst index fa88390356..bf367fd989 100644 --- a/docs/releases/1.4.4.rst +++ b/docs/releases/1.4.4.rst @@ -20,3 +20,4 @@ Bug fixes * Redirects no longer fail when both a site-specific and generic redirect exist for the same URL path (Nick Smith, João Luiz Lorencetti) * Wagtail now checks that Group is registered with the Django admin before unregistering it (Jason Morrison) * Previewing inaccessible pages no longer fails with ``ALLOWED_HOSTS = ['*']`` (Robert Rollins) + * The submit button 'spinner' no longer activates if the form has client-side validation errors (Jack Paine, Matt Westcott) diff --git a/wagtail/wagtailadmin/static_src/wagtailadmin/js/core.js b/wagtail/wagtailadmin/static_src/wagtailadmin/js/core.js index 92d62e840c..5d7e593ae8 100644 --- a/wagtail/wagtailadmin/static_src/wagtailadmin/js/core.js +++ b/wagtail/wagtailadmin/static_src/wagtailadmin/js/core.js @@ -223,6 +223,13 @@ $(function() { var reEnableAfter = 30; var dataName = 'disabledtimeout' + // Check the form this submit button belongs to (if any) + var form = $self.closest('form').get(0); + if (form && form.checkValidity && (form.checkValidity() == false)) { + // ^ Check form.checkValidity returns something as it may not be browser compatible + return; + } + // Disabling a button prevents it submitting the form, so disabling // must occur on a brief timeout only after this function returns.