Revision code

Changes Version 2.5.0
Released on December 14, 2021 with 32 commits

Changes

This is a maintenance release while we're working on the next major feature update.

  • The event up:form:submit has a new property { submitButton }. It points to the <button> or <input> element used to submit the form, if the form was submitted with a button.
  • The event up:form:submit has a new property { params }. It points to an editable up.Params object for the form's data payload.
  • Fix a bug where [up-validate] would use form attributes intended for the final form submission, like [up-scroll] or [up-confirm].
  • Fix a bug where an .up-current class would sometimes match an [up-alias] pattern in the middle of the current URL. This happened when [up-alias] contained multiple patterns and the last pattern is a prefix (e.g. /foo/*).
  • New option up.log.config.format lets you disable colors from log messages (thanks @stefanfisk!).
  • Elements with [up-keep] are now preserved when going back/forward in history (#293).
  • The function up.element.createFromHTML() now creates an element if the given HTML string begins with whitespace.
  • The function up.element.createFromHTML() now throws an error if the given HTML string contains more than one element on the root depth.
  • Elements matching up.link.config.clickableSelectors now get a cursor: pointer style through CSS.
  • Published new events to observe closing overlay (up:layer:dismiss, up:layer:dismissed, up:layer:accept, up:layer:accepted). These events were implemented since Unpoly 2.0, but never documented.
  • Fix a bug where loading Unpoly would save a key called "undefined" to sessionStorage (#300).

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.