- common-error-styles.scss renamed to common-validation-styles.scss - Added 'has-success' to dropdown-question component - Updated dropdown-question to only show error/success when not disabled - Fixed issue with focusing first invalid input in base-form-mixin
31 lines
908 B
JavaScript
31 lines
908 B
JavaScript
import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
|
|
|
export default {
|
|
mounted() {
|
|
showIssLoadingModal(false);
|
|
},
|
|
methods: {
|
|
onSubmit() {
|
|
/**
|
|
* DO NOT REMOVE;
|
|
* Needed to prevent default form submit behavior.
|
|
* Cannot use .prevent modifier for vee-validate Form.
|
|
*/
|
|
},
|
|
onInvalidSubmit({ errors }) {
|
|
/**
|
|
* 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) {
|
|
const qsString = `[name="${firstErrorEl}"]`;
|
|
const el = document.querySelector(qsString);
|
|
if (el !== null) {
|
|
el.focus();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|