Skip to content

Instantly share code, notes, and snippets.

@tdgroot
Created November 19, 2020 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdgroot/d658d71567360f0f8aedca6ed2658244 to your computer and use it in GitHub Desktop.
Save tdgroot/d658d71567360f0f8aedca6ed2658244 to your computer and use it in GitHub Desktop.
Patch for issue magento/magento2#30513
--- view/frontend/web/js/block-submit-on-send.orig.js 2020-11-19 12:44:54.544000000 +0100
+++ view/frontend/web/js/block-submit-on-send.js 2020-11-19 12:45:18.409967078 +0100
@@ -14,9 +14,15 @@
dataForm.submit(function () {
$(this).find(':submit').attr('disabled', 'disabled');
+
+ if (this.isValid === false) {
+ $(this).find(':submit').prop('disabled', false);
+ }
+ this.isValid = true;
});
dataForm.bind('invalid-form.validate', function () {
$(this).find(':submit').prop('disabled', false);
+ this.isValid = false;
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment