Revision code

Changes Version 3.7.2
Released on January 11, 2024 with 7 commits

Validation

This change addresses multiple edge cases with concurrent user input during form validations:

  • It is now possible to queue a validation for a fragment while a validation request for the same target is still loading.
  • Validations no longer throw an error if a targeted fragment is destroyed while a validation request is loading. Instead Unpoly will only update the fragments that are still present on the page (if any).
  • Validations are now aborted if the entire <form> element is aborted. Previously individual validations were aborted when their target was aborted.
  • up.validate() now rejects with an up.Aborted error if a debounce delay was aborted (by aborting the <form> element).
  • When a new validation is queued while a previous validation request is still loading, the full debounce delay of the new validation is now honored.

Autosubmit fixes

This change fixes two more regressions for [up-autosubmit], introduced by 3.7.0:

  • When the user changes a form field while a previous autosubmission is still loading, prevent that new change from being lost.
  • A debounce delay is now aborted if the entire <form> element is aborted. It no longer aborts the delay when the form's target is aborted.

Fragment API

Upgrading

If you're upgrading from an older Unpoly version you should load unpoly-migrate.js to polyfill deprecated APIs. Changes handled by unpoly-migrate.js are not considered breaking changes.

See our upgrading guide for details.