Fix bug where form's novalidate
attribute is not respected
This commit is contained in:
parent
c5e28a7b41
commit
69c47658c7
1 changed files with 7 additions and 3 deletions
|
@ -31,9 +31,13 @@ class GlFieldErrors {
|
|||
* and prevents disabling of invalid submit button by application.js */
|
||||
|
||||
catchInvalidFormSubmit (event) {
|
||||
if (!event.currentTarget.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const $form = $(event.currentTarget);
|
||||
|
||||
if (!$form.attr('novalidate')) {
|
||||
if (!event.currentTarget.checkValidity()) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue