Open History to see the last commit
1import { html, nothing } from 'lit'
2import type { AnyFieldApi } from '@tanstack/lit-form'
3β
4export function fieldError(field: AnyFieldApi) {
5 return html`<small
6 role=${field.meta.isInvalid ? 'alert' : nothing}
7 aria-live="polite"
8 >${field.errors.map((error) => error.message).join('\n')}</small
9 >`
10}