docs for 1.4

This commit is contained in:
carson 2021-05-21 11:18:32 -06:00
parent 085d26ba93
commit 16438c1d2e
4 changed files with 30 additions and 0 deletions

View File

@ -1,6 +1,27 @@
# Changelog
## [1.4.0] - 2021-5-25
* Added the `queue` option to the [hx-trigger](/attributes/hx-trigger) attribute, allowing you to specify how events
should be queued when they are received with a request in flight
* The `htmx.config.useTemplateFraments` option was added, allowing you to use HTML template tags for parsing content
from the server. This allows you to use Out of Band content when returning things like table rows, but it is not
IE11 compatible.
* Introduced a new synthetic event, [intersect](/docs#pecial-events) that allows you to trigger when an item is scrolled into view
as specified by the `IntersectionObserver` API
* Fixed timing issue that caused exceptions in the `reveal` logic when scrolling at incredible speeds - <https://github.com/bigskysoftware/htmx/issues/463>
* Fixed bug causing SVG titles to be incorrectly used as page title - <https://github.com/bigskysoftware/htmx/issues/459>
* Boosted forms that issue a GET will now push the URL by default - <https://github.com/bigskysoftware/htmx/issues/485>
* Better dispatch of request events when an element is removed from the DOM
* Fixed a bug causing `hx-prompt` to fail
* The `htmx.config.withCredentials` option was added, to send credentials with ajax requests (default is `false`)
* The `throttle` option on `hx-trigger` does not delay the initial request any longer
* The `meta` key is ignored on boosted links
* `hx-swap` now supports the `none` option
* Added the [`hx-disabled`](/docs#security) attribute to allow htmx to be turned off for parts of the DOM
* Safari text selection bug - <https://github.com/bigskysoftware/htmx/issues/438>
## [1.3.3] - 2021-4-5
* Added the [`hx-disabled`](/docs#security) attribute to allow htmx to be turned off for parts of the DOM

View File

@ -98,6 +98,7 @@ Note that using a [meta tag](/docs/#config) is the preferred mechanism for setti
* `settlingClass:'htmx-settling'` - string: the class to place on target elements when htmx is in the settling phase
* `swappingClass:'htmx-swapping'` - string: the class to place on target elements when htmx is in the swapping phase
* `allowEval:true` - boolean: allows the use of eval-like functionality in htmx, to enable `hx-vars`, trigger conditions & script tag evaluation. Can be set to `false` for CSP compatibility
* `htmx.config.useTemplateFraments:false` - boolean: use HTML template tags for parsing content from the server. This allows you to use Out of Band content when returning things like table rows, but it is *not* IE11 compatible.
* `withCredentials:false` - boolean: allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates
* `wsReconnectDelay:full-jitter` - string/function: the default implementation of `getWebSocketReconnectDelay` for reconnecting after unexpected connection loss by the event code `Abnormal Closure`, `Service Restart` or `Try Again Later`

View File

@ -63,6 +63,11 @@ triggers from elements that might not be in the DOM at the point of initializati
but with a target filter for a child element
* `consume` - if this option is included the event will not trigger any other htmx requests on parents (or on elements
listening on parents)
* `queue:<queue option>` - determines how events are queued if an event occurs while a request for another event is in flight. Options are:
* `first` - queue the first event
* `last` - queue the last event (default)
* `all` - queue all events (issue a request for each event)
* `none` - do not queue new events
Here is an example of a search box that searches on `keyup`, but only if the search value has changed
and the user hasn't typed anything new for 1 second:

View File

@ -211,6 +211,9 @@ htmx provides a few special events for use in [hx-trigger](/attributes/hx-trigge
* `load` - fires once when the element is first loaded
* `revealed` - fires once when an element first scrolls into the viewport
* `intersect` - fires once when an element first intersects the viewport. This supports two additional options:
* `root:<selector>` - a CSS selector of the root element for intersection
* `threshold:<float>` - a floating point number between 0.0 and 1.0, indicating what amount of intersection to fire the event on
You can also use custom events to trigger requests if you have an advanced use case.