Enhances Roqueform fields with methods to scroll to the closest invalid field.
import { createField } from 'roqueform';import scrollToErrorPlugin from 'roqueform/plugin/scroll-to-error';const field = createField({ hello: 'world' }, [scrollToErrorPlugin()]);field.at('hello').ref(document.querySelector('input'));field.at('hello').isInvalid = true;field.scrollToError();// ⮕ field.at('hello') Copy
import { createField } from 'roqueform';import scrollToErrorPlugin from 'roqueform/plugin/scroll-to-error';const field = createField({ hello: 'world' }, [scrollToErrorPlugin()]);field.at('hello').ref(document.querySelector('input'));field.at('hello').isInvalid = true;field.scrollToError();// ⮕ field.at('hello')
Enhances Roqueform fields with methods to scroll to the closest invalid field.