CSR-319: remove console logs / comments

This commit is contained in:
Adam Caouette 2022-03-11 10:40:50 -05:00
parent 00d69f8710
commit 0bcd842aff

View file

@ -23,20 +23,13 @@ export default {
},
onSubmit() {}, // DO NOT REMOVE; needed to prevent default form submit behavior
onInvalidSubmit({ values, errors, results }) {
console.log('errors: ', errors)
// {DamageLocationQuestion: 'Please select damage location'}
// {driverSideOptions: 'Please select window', passengerSideOptions: 'Please select window'}
// identify the first error field and put focus on it
// get error names array
const errorNames = errors ? Object.keys(errors) : [];
const firstErrorEl = errorNames[0];
if (firstErrorEl) {
console.log('firstErrorEl: ', firstErrorEl)
const qsString = "[data-focus-target='" + firstErrorEl + "']";
const el = document.querySelector(qsString);
console.log('el is: ', el)
el && el.focus();
}
},