# Changelog ## [1.9.9] - 2023-11-21 * Allow CSS selectors with whitespace in attributes like `hx-target` by using parens or curly-braces * Properly allow users to override the `Content-Type` request header * Added the `select` option to `htmx.ajax()` * Fixed a race condition in readystate detection that lead to htmx not being initialized in some scenarios with 3rd party script loaders * Fixed a bug that caused relative resources to resolve against the wrong base URL when a new URL is pushed * Fixed a UI issue that could cause indicators to briefly flash ## [1.9.8] - 2023-11-06 * Fixed a few npm & build related issues ## [1.9.7] - 2023-11-03 * Fixed a bug where a button associated with a form that is swapped out of the DOM caused errors * The `hx-target-error` attribute was added to the `response-targets` extension, allowing you to capture all 400 & 500 responses with a single attribute * `hx-on` now properly supports multiple listeners * The `hx-confirm` prompt is now passed into custom confirmation handlers * `next` and `previous` are now valid _extended CSS_ symbols in htmx * The `htmx:beforeHistoryUpdate` event was added * Properly ignore the `dialog` formmethod on buttons when resolving the HTTP method to use * Added a `htmx.config.scrollIntoViewOnBoost` option that may be set to `false` to disable scrolling the top of the body into view for boosted elements ## [1.9.6] - 2023-09-22 * IE support has been restored (thank you @telroshan!) * Introduced the `hx-disabled-elt` attribute to allow specifing elements to disable during a request * You can now explicitly decide to ignore `title` tags found in new content via the `ignoreTitle` option in `hx-swap` and the `htmx.config.ignoreTitle` configuration variable. * `hx-swap` modifiers may be used without explicitly specifying the swap mechanism * Arrays are now supported in the `client-side-templates` extension * XSLT support in the `client-side-templates` extension * Support `preventDefault()` in extension event handling * Allow the `HX-Refresh` header to apply even after an `HX-Redirect` has occurred * the `formaction` and `formmethod` attributes on buttons are now properly respected * `hx-on` can now handle events with dots in their name * `htmx.ajax()` now always returns a Promise * Handle leading `style` tag parsing more effectively ## [1.9.5] - 2023-08-25 * Web sockets now properly pass the target id in the HEADERS struct * A very rare loading state bug was fixed (see https://github.com/bigskysoftware/htmx/commit/93bd81b6d003bb7bc445f10192bdb8089fa3495d) * `hx-on` will not evaluate if `allowEval` is set to false * You can disable the interpretation of script tags with the new `htmx.config.allowScriptTags` config variable * You can now disable htmx-based requests to non-origin hosts via the `htmx.config.selfRequestsOnly` config variable * The [Security](https://htmx.org/docs#security) section has been expanded to help developers better understand how to properly secure their htmx-based applications. ## [1.9.4] - 2023-07-25 * This is a bug-fix release for the most part, w/a heavy dose of @telroshan * The `HX-Trigger` response header now supports comma separated event names * Submit buttons that use the `form` attribute now work correctly * The `changed` modifier now uses the triggering element, rather than the element the `hx-trigger` is defined on * `hx-disable` is now handled dynamically so it can be added and removed * IE11 compatibility restored! (maybe, hard to test) * Fixed bug with `hx-on` event handler cleanup * Many smaller bug fixes, typo fixes and general improvements ## [1.9.3] - 2023-07-14 * The `hx-on` attribute has been deprecated (sorry) in favor of `hx-on:` attributes. See [`hx-on`](/attributes/hx-on) for more information. * We now have functioning CI using GitHub actions! * You can now configure if a type of HTTP request uses the body for parameters or not. In particular, the `DELETE` _should_ use query parameters, according to the spec. htmx has used the body, instead. To avoid breaking code we are keeping this undefined behavior for now, but allowing people to fix it for their use cases by updating the `htmx.config.methodsThatUseUrlParams` config option. Thank you to Alex and Vincent for their feedback and work on this issue! * The `this` symbol is now available in event filter expressions, and refers to the element the `hx-trigger` is on * Fix bug where the `htmx:afterSettle` event was raised multiple times with oob swaps occurred * A large number of accessibility fixes were made in the docs (Thank you Denis & crew!) * Fixed bug w/ WebSocket extension initialization caused by "naked" `hx-trigger` feature * The `HX-Reselect` HTTP response header has been added to change the selection from the returned content * Many other smaller bug fixes ## [1.9.2] - 2023-04-28 * Fixed bug w/ `hx-on` not properly de-initializing ## [1.9.1] - 2023-04-27 * Fixed a bug with the new naked triggers that prevented boosted elements with explicit `hx-trigger`'s from functioning properly * Added code to play well with other libraries that also use the `window.onpopstate` Daily reminder: ## [1.9.0] - 2023-04-11 * Support for generalized inline event handling via the new [`hx-on`](/attributes/hx-on) attribute, which addresses the shortcoming of limited [`onevent` properties](https://developer.mozilla.org/en-US/docs/Web/Events/Event_handlers#using_onevent_properties) attributes in HTML. * Support for [view transitions](/docs#view-transitions), based on the experimental [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API) currently available in Chrome 111+ and coming to other browsers soon. * Support for "naked" [`hx-trigger`](/attributes/hx-trigger) attributes, where an `hx-trigger` is present on an element that does not have an `hx-get`, etc. defined on it. Instead, it will trigger the new `htmx:triggered` event, which can be responded to via your [preferred scripting solution](/docs#scripting). * A memory leak fix by [@croxton](https://github.com/bigskysoftware/htmx/commit/8cd3a480a7388877628ce8b9b8e50cd5df48bb81) * The htmx website has been migrated from 11ty to [zola](https://www.getzola.org/) by [@danieljsummers](https://github.com/danieljsummers), cutting way down on the number of "development" javascript dependencies * Many other smaller bug fixes ## [1.8.6] - 2023-03-02 * ESM support! * Sass has been vanquished from the htmx.org website, which should set us up for some good progress going forward * Fixed a bug where the `changed` modifier on `keyup` did not work properly if an input was tabbed into * Many other smaller bug fixes and doc fixes ## [1.8.5] - 2023-01-17 * Support a new optional cache-busting configuration option, `getCacheBusterParam`, to allow browsers to disambiguate between `GET` requests from htmx and from the raw browser * Support new `hx-history='false'` attribute, to prevent sensitive data from being stored in the history cache. (Thank you @croxton!) * Extensive new event-oriented features are available in the [Web Socket](/extensions/web-sockets/) extension (Thank you @Renerick!) * A bug fix for when a form contains multiple empty input values with the same name (Thank you @bluekeyes!) * A bug fix around inputs that throw exceptions when calling `setSelectionRange()` (Thank you @gone!) * A bug fix to pass through the proper event for the `htmx:configRequest` event * A bug fix/improvement for the `preload` extension * Many other small bug fixes ## [1.8.4] - 2022-11-05 * Fix the _exact same_ regression in `revealed` logic as in 1.8.2 ## [1.8.3] - 2022-11-04 * A new [`htmx:confirm` event](/events#htmx:confirm) was added that allows for asynchronous confirmation dialogs to be integrated into htmx requests * The new [head-support](/extensions/head-support) extension allows for more elaborate head tag merging than standard htmx supports. This functionality may be integrated into htmx 2.0, depending on feedback. * The new [multi-swap](/extensions/multi-swap) provides more elaborate swapping of multiple elements on a screen using a custom swap strategy * Many doc fixes (thank you to everyone who contributed!) ## [1.8.2] - 2022-10-12 * Fix regression in `revealed` logic ## [1.8.1] - 2022-10-11 * We now keep a count of outstanding requests for an indicator, so more than one overlapping request can share the same indicator without issues * We now track the attribute state of an element and re-initialize it if `htmx.process()` is called on the element and the attributes have changed * [Idiomorph](https://github.com/bigskysoftware/idiomorph) is now available for all your morph-swapping needs * The `unset` directive now works properly for `hx-vals` and `hx-vars` * The title of the page is now properly set on a history cache miss * The new [`hx-validate`](https://htmx.org/attributes/hx-validate) attribute will force elements to validate before a request, even if they are not within a form being submitted * Many smaller bug and docs fixes ## [1.8.0] - 2022-7-12 * **NOTE**: This release involved some changes to touchy code (e.g. history support) so please test thoroughly and let us know if you see any issues * Boosted forms now will automatically push URLs into history as with links. The [response URL](https://caniuse.com/mdn-api_xmlhttprequest_responseurl) detection API support is good enough that we feel comfortable making this the default now. * If you do not want this behavior you can add `hx-push-url='false'` to your boosted forms * The [`hx-replace-url`](https://htmx.org/attributes/hx-replace-url) attribute was introduced, allowing you to replace the current URL in history (to complement `hx-push-url`) * Bug fix - if htmx is included in a page more than once, we do not process elements multiple times * Bug fix - When localStorage is not available we do not attempt to save history in it * [Bug fix](https://github.com/bigskysoftware/htmx/issues/908) - `hx-boost` respects the `enctype` attribute * `m` is now a valid timing modifier (e.g. `hx-trigger="every 2m"`) * `next` and `previous` are now valid extended query selector modifiers, e.g. `hx-target="next div"` will target the next div from the current element * Bug fix - `hx-boost` will boost anchor tags with a `_self` target * The `load` event now properly supports event filters * The websocket extension has had many improvements: (A huge thank you to Denis Palashevskii, our newest committer on the project!) * Implement proper `hx-trigger` support * Expose trigger handling API to extensions * Implement safe message sending with sending queue * Fix `ws-send` attributes connecting in new elements * Fix OOB swapping of multiple elements in response * The `HX-Location` response header now implements client-side redirects entirely within htmx * The `HX-Reswap` response header allows you to change the swap behavior of htmx * The new [`hx-select-oob`](https://htmx.org/attributes/hx-select-oob) attribute selects one or more elements from a server response to swap in via an out of band swap * The new [`hx-replace-url`](https://htmx.org/attributes/hx-replace-url) attribute can be used to replace the current URL in the location bar (very similar to `hx-push-url` but no new history entry is created). The corresponding `HX-Replace-Url` response header can be used as well. * htmx now properly handles anchors in both boosted links, as well as in `hx-get`, etc. attributes ## [1.7.0] - 2022-02-22 * The new [`hx-sync`](https://htmx.org/attributes/hx-sync) attribute allows you to synchronize multiple element requests on a single element using various strategies (e.g. replace) * You can also now abort an element making a request by sending it the `htmx:abort` event * [Server Sent Events](/extensions/server-sent-events) and [Web Sockets](/extensions/web-sockets) are now available as extensions, in addition to the normal core support. In htmx 2.0, the current `hx-sse` and `hx-ws` attributes will be moved entirely out to these new extensions. By moving these features to extensions we will be able to add functionality to both of them without compromising the core file size of htmx. You are encouraged to move over to the new extensions, but `hx-sse` and `hx-ws` will continue to work indefinitely in htmx 1.x. * You can now mask out [attribute inheritance](/docs#inheritance) via the [`hx-disinherit`](https://htmx.org/attributes/hx-disinherit) attribute. * The `HX-Push` header can now have the `false` value, which will prevent a history snapshot from occurring. * Many new extensions, with a big thanks to all the contributors! * A new [`alpine-morph`](/extensions/alpine-morph) allows you to use Alpine's swapping engine, which preserves Alpine * A [restored](/extensions/restored) extension was added that will trigger a `restore` event on all elements in the DOM on history restoration. * A [loading-states](/extensions/loading-states) extension was added that allows you to easily manage loading states while a request is in flight, including disabling elements, and adding and removing CSS classes. * The `this` symbol now resolves properly for the [`hx-include`](https://htmx.org/attributes/hx-include) and [`hx-indicator`](https://htmx.org/attributes/hx-indicator) attributes * When an object is included via the [`hx-vals`](https://htmx.org/attributes/hx-vals) attribute, it will be converted to JSON (rather than rendering as the string `[Object object]"`) * You can now pass a swap style in to the `htmx.ajax()` function call. * Poll events now contain a `target` attribute, allowing you to filter a poll on the element that is polling. * Two new Out Of Band-related events were added: `htmx:oobBeforeSwap` & `htmx:oobAfterSwap` ## [1.6.1] - 2021-11-22 * A new `HX-Retarget` header allows you to change the default target of returned content * The `htmx:beforeSwap` event now includes another configurable property: `detail.isError` which can be used to indicate if a given response should be treated as an error or not * The `htmx:afterRequest` event has two new detail properties: `success` and `failed`, allowing you to write trigger filters in htmx or hyperscript: ```applescript on htmx:afterRequest[failed] set #myCheckbox's checked to true ``` * Fixed the `from:` option in [`hx-trigger`](https://htmx.org/attributes/hx-trigger) to support `closest ` and `find ` forms * Don't boost anchor tags with an explicit `target` set * Don't cancel all events on boosted elements, only the events that naturally trigger them (click for anchors, submit for forms) * Persist revealed state in the DOM so that on history navigation, revealed elements are not re-requested * Process all [`hx-ext`](https://htmx.org/attributes/hx-ext) attributes, even if no other htmx attribute is on the element * Snapshot the current URL on load so that history support works properly after a page refresh occurs * Many, many documentation updates (thank you to all the contributors!) ## [1.6.0] - 2021-10-01 * Completely reworked `