Skip to content
Snippets Groups Projects
Commit 5f0b7fe4 authored by Bryce Johnson's avatar Bryce Johnson
Browse files

Stop injecting field errors where they won't be used.

parent b5cee666
No related branches found
No related tags found
1 merge request!6929Stop injecting field errors where they won't be used.
Pipeline #
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment