Commit 69c47658 authored by kushalpandya's avatar kushalpandya Committed by Jarka Kadlecova

Fix bug where form's `novalidate` attribute is not respected

parent c5e28a7b
......@@ -31,11 +31,15 @@ class GlFieldErrors {
* and prevents disabling of invalid submit button by application.js */
catchInvalidFormSubmit (event) {
const $form = $(event.currentTarget);
if (!$form.attr('novalidate')) {
if (!event.currentTarget.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
}
}
/* Public method for triggering validity updates manually */
updateFormValidityState() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment