Stop injecting field errors where they won't be used.
This commit is contained in:
parent
b5cee66612
commit
5f0b7fe429
|
@ -137,8 +137,11 @@
|
|||
}
|
||||
|
||||
initValidators () {
|
||||
// select all non-hidden inputs in form
|
||||
this.state.inputs = this.form.find(':input:not([type=hidden])').toArray()
|
||||
// register selectors here as needed
|
||||
const validateSelectors = [':text', ':password', '[type=email]']
|
||||
.map((selector) => `input${selector}`).join(',');
|
||||
|
||||
this.state.inputs = this.form.find(validateSelectors).toArray()
|
||||
.filter((input) => !input.classList.contains(customValidationFlag))
|
||||
.map((input) => new GlFieldError({ input, formErrors: this }));
|
||||
|
||||
|
|
Loading…
Reference in New Issue