---
area: "Changes"
parent: "Changes"
url: "https://unpoly.com/changes/3.9.0"
released: "2024-08-28"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [Changes](https://unpoly.com/changes.md)</nav>

# Version 3.9.0

Released on August 28, 2024 with [88 commits](https://github.com/unpoly/unpoly/commits/v3.9.0)

This release brings many fixes and quality-of-life improvements that were requested by the community.

The vast majority of these changes are backward compatible. One breaking change can be found with [making links followable](#making-links-followable). Existing usage is polyfilled by [`unpoly-migrate.js`](https://unpoly.com/changes/upgrading.md).

<nav aria-label="Contents">

- [Emitting events on buttons](#emitting-events-on-buttons)
- [Improvements to faux-interactive elements](#improvements-to-faux-interactive-elements)
- [Making links followable](#making-links-followable)
- [Polling](#polling)
- [Forms](#forms)
- [Smooth scrolling](#smooth-scrolling)
- [Various](#various)
- [Upgrading](#upgrading)

</nav>

## Emitting events on buttons {#emitting-events-on-buttons}

- You can now use [`[up-emit]`](https://unpoly.com/api/up-emit.md) to emit an event when any element is clicked. In particular this works with a `<button>` or any [faux-interactive element](https://unpoly.com/learn/faux-interactive-elements.md) (issue [#416](https://github.com/unpoly/unpoly/issues/416)).

## Improvements to faux-interactive elements {#improvements-to-faux-interactive-elements}

Sometimes you need to add a `click` listener to non-interactive elements (like `<span>`). Unpoly helps you [prevent accessibility issues](https://unpoly.com/learn/faux-interactive-elements.md#accessibility) with such "faux-interactive" elements, by offering the [`[up-clickable]`](https://unpoly.com/api/up-clickable.md) attribute and [`up.link.config.clickableSelectors`](https://unpoly.com/api/up.link.config.md#config.clickableSelectors) configuration. Unpoly also leverages this for its own faux-interactive elements, such as [`[up-emit]`](https://unpoly.com/api/up-emit.md) or [`[up-dismiss]`](https://unpoly.com/api/up-dismiss.md). This release improves the handling of faux-interactive elements:

- A new documentation guide [Clicking non-interactive elements](https://unpoly.com/learn/faux-interactive-elements.md) details all the methods to emulate interactivity on non-interactive elements like `<span>` or `<div>`.
- You can now define exceptions to [`up.link.config.clickableSelectors`](https://unpoly.com/api/up.link.config.md#config.clickableSelectors), by setting an `[up-clickable=false]` attribute or configuring [`up.link.config.noClickableSelectors`](https://unpoly.com/api/up.link.config.md#config.noClickableSelectors).
- Adjusted the handling of keyboard input to better match the behavior of real buttons and links. In particular, faux-interactive elements with a [button role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role) (default) can be activated with both `Space` and `Enter` keys. Faux-interactive elements with a `[role=link]` can only be activated with the `Enter` key.
- Faux-interactive elements that also have the [`[up-follow]`](https://unpoly.com/api/up-follow.md) attribute now default to `[role=link]` (instead of the default `[role=button]`).
- Faux-interactive elements with a button role no longer have the "hand" (or "pointer") cursor.
- Fix a bug where faux-interactive elements inside popups could not be activated with the keyboard (#653).

## Making links followable {#making-links-followable}

- 🧩 Links with only an [`[up-href]`](https://unpoly.com/api/up-href.md) attribute are no longer followable by default. They also require an [`[up-follow]`](https://unpoly.com/api/up-follow.md) attribute or a match in [`up.link.config.followSelectors`](https://unpoly.com/api/up.link.config.md#config.followSelectors). This change was made to remove confusion with other features that use [`[up-href]`](https://unpoly.com/api/up-href.md), such as [`[up-defer]`](https://unpoly.com/api/up-defer.md) and (since this release) [`[up-poll]`](https://unpoly.com/api/up-poll.md).
- 🧩 Links with only an [`[up-instant]`](https://unpoly.com/api/up-instant.md) attribute are no longer followable by default. They also require an [`[up-follow]`](https://unpoly.com/api/up-follow.md) attribute or a match in [`up.link.config.followSelectors`](https://unpoly.com/api/up.link.config.md#config.followSelectors). This change was made to remove confusion with other features that use [`[up-instant]`](https://unpoly.com/api/up-instant.md), in particular [`up:click`](https://unpoly.com/api/up:click.md) on [faux-interactive elements](https://unpoly.com/learn/faux-interactive-elements.md).

## Polling {#polling}

- Listeners to the [`up:fragment:poll`](https://unpoly.com/api/up:fragment:poll.md) event can now inspect or mutate `event.renderOptions`. This allows more control over the polling request and subsequent render passes.
- [`[up-poll]`](https://unpoly.com/api/up-poll.md) elements can now use the [`[up-href]`](https://unpoly.com/api/up-href.md) attribute to poll from a different URL. By default Unpoly will poll the URL from which the element was originally loaded. The old method over overriding [`[up-source]`](https://unpoly.com/api/up-source.md) is still supported, but [`[up-href]`](https://unpoly.com/api/up-href.md) is the preferred way of doing this going forward.
- [`[up-poll]`](https://unpoly.com/api/up-poll.md) elements can now use the `[up-method]` attribute to choose a different HTTP method for polling requests.
- [`[up-poll]`](https://unpoly.com/api/up-poll.md) elements can now use the `[up-params]` attribute to add custom params to polling requests.
- [`[up-poll]`](https://unpoly.com/api/up-poll.md) elements can now use the `[up-headers]` attribute to add custom headers to polling requests.

## Forms {#forms}

- Focus is now preserved when submitting a form by pressing `Enter` from a focused field ([discussion #658](https://github.com/unpoly/unpoly/discussions/658)).
- ⚠️ The [`up.submit()`](https://unpoly.com/api/up.submit.md) now includes the `[name]` and `[value]` of the default submit button in the submitted params. By default the form's first submit button will be assumed. You can prevent this with `{ submitButton: false }`, or pass a different button element as `{ submitButton }`.
- Fix an interop issue with the [Shoelace](https://shoelace.style/) web component library, where a failed response could not be processed when the form was submitted with an `<sl-button>` ([discussion #643](https://github.com/unpoly/unpoly/discussions/643)).

## Smooth scrolling {#smooth-scrolling}

- Support [smooth scrolling](https://unpoly.com/learn/scroll-tuning.md#animating-the-scroll-motion) when swapping a fragment.
- Fix smooth scrolling when [prepending or appending](https://unpoly.com/learn/targeting-fragments.md#appending-or-prepending) content.

## Various {#various}

- Fix: up-alias not matching URL query string with asterix after shash (#542)
- Fix a bug where an overlay with viewport would not correctly shift multiple right-fixed elements
- [`[up-defer]`](https://unpoly.com/api/up-defer.md) elements no longer have a hand cursor
- Events like [`up:link:follow`](https://unpoly.com/api/up:link:follow.md) can now [open a layer with a given mode](https://unpoly.com/learn/opening-overlays.md#modes) using the shorthand notation `event.renderOptions.layer = "new drawer"`.
- Avoid logging `Uncaught AbortError` when the user presses the back button, but a script prevents the [`up:location:restore`](https://unpoly.com/api/up:location:restore.md) event.
- Avoid logging `Uncaught AbortError` when the user closes the overlay, but a script prevents the [`up:layer:dismiss`](https://unpoly.com/api/up:layer:dismiss.md) or [`up:layer:accept`](https://unpoly.com/api/up:layer:accept.md) event.
- Reduce the number of [layer lookups](https://unpoly.com/api/up.layer.get.md) during a render pass.

## Upgrading {#upgrading}

If you're upgrading from an older Unpoly version you should load [`unpoly-migrate.js`](https://unpoly.com/changes/upgrading.md) to polyfill deprecated APIs. Changes handled by `unpoly-migrate.js` are not considered breaking changes.

See our [upgrading guide](https://unpoly.com/changes/upgrading.md) for details.

