Skip to content

v3.32.0

Choose a tag to compare

@tjloong tjloong released this 02 Oct 10:26
· 26 commits to main since this release
dca4f13

<atom:form> now tells the user when a submit fails validation, so a long form whose error is off screen no longer looks like Save did nothing (requested from firmhive).

Added

  • Error toast on a failed submit. A danger toast headed "Please check the form" lists the errors of the fields the submitted form renders (wire:model* / name), each once, five at most, then "and N more". It never scrolls or moves focus.
    • On by default. Opt out per form with :error-toast="false". A disabled form never shows one.
    • Outside a modal it is sticky: it stays until ✕, or until the same form's next submit comes back clean. It never closes your own toasts (e.g. "Saved").
    • Inside a <dialog> it is timed (6s) and closes with the dialog — a modal makes the rest of the page inert, so a sticky toast's ✕ couldn't be clicked there.
    • Only the form's own fields. An error with no field in the form (a failed API call, addError('general', ...)) is not listed and does not toast — report those yourself, e.g. with $this->toast(...).
    • Needs <atom:toast> mounted on the page (the sidebar layout has it); does nothing without. The form's wire:target must name the submit method (atom sets it).
    • The toast is a singleton: if your method already toasts its own validation message, whichever shows last wins.
  • New atom-toast-close window event: with source in the detail it closes only a toast shown with that source; without, whatever is open.
  • The toast now has role="status" aria-live="polite".

dist/ rebuilt.