Skip to content

Automatic error display #10

Closed
Closed

Description

@n4ff4h

Errors appear under the right field automatically: Laravel validation errors (Inertia props, JSON 422 responses), error bags, nested/array keys (items.0.name), and an error summary component. Accessible: aria-invalid, aria-describedby, focus first invalid field on submit.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    450f778
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen (450f778). src/core/errors.ts holds the error logic and src/core/errors.test.tsx has 18 cases. Docs: docs/basic-usage/errors.md.

    Decisions:

    • Array fields: a field named tags[] also shows tags.N errors. Laravel reports tags.* rules per item.
    • Error bags: the bag is selected with errorBag (Laravel's validateWithBag, Inertia's errorBag). Without a bag, nested bag objects are ignored.
    • Editing a field: this hides its errors, server and page alike, until new errors arrive.
    • ErrorSummary: a new component with no Blade v1 equivalent. It is listed in docs/parity.md for the forms agent. The Form renders one unless summary={false}.
    • Focus: when errors arrive, the first invalid field is focused and revealed. A forms:reveal event opens tabs and accordions. Onu's onu:reveal is dispatched too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions