UNPKG

@modular-forms/react

Version:

The modular and type-safe form library for React

11 lines (10 loc) 271 B
import { getFieldStore } from '../utils'; /** * Focuses the specified field of the form. * * @param form The form of the field. * @param name The name of the field. */ export function focus(form, name) { getFieldStore(form, name)?.elements.peek()[0]?.focus(); }