is it possible to scroll to the first error field ?
Yes. You have to implement scrolling to the node on your own. Vuelidate already makes it pretty easy to detect where error occured by inspecting $v.
I got this to work, but a non-native javascript with scroll animation would be better.
In your template:
<input :class="{ 'input--error': $v.name.$error}" >
In your methods:
```
this.$nextTick(() => {
let domRect = document.querySelector('.input--error').getBoundingClientRect();
window.scrollTo(
domRect.left + document.documentElement.scrollLeft,
domRect.top + document.documentElement.scrollTop
);
})
For anyone discovering this via Google: I've written an article about how to scroll to the first Vuelidate validation error.
Most helpful comment
I got this to work, but a non-native javascript with scroll animation would be better.
In your template:
In your methods:
```
this.$nextTick(() => {
let domRect = document.querySelector('.input--error').getBoundingClientRect();
window.scrollTo(
domRect.left + document.documentElement.scrollLeft,
domRect.top + document.documentElement.scrollTop
);
})