diff --git a/www/attributes/hx-ext.md b/www/attributes/hx-ext.md index 166a0e99..d0ee81aa 100644 --- a/www/attributes/hx-ext.md +++ b/www/attributes/hx-ext.md @@ -16,3 +16,16 @@ and on the `body` tag for it to apply to all htmx requests. * `hx-ext` is both inherited and merged with parent elements, so you can specify extensions on any element in the DOM hierarchy and it will apply to all child elements. + +* You can ignore an extension that is defined by a parent node using `hx-ext="ignore:extensionName"` + + +```html +
+ "Example" extension is used in this part of the tree... +
+ ... but it will not be used in this part. +
+
+``` + diff --git a/www/docs.md b/www/docs.md index 7273c1c2..fe84f6f5 100644 --- a/www/docs.md +++ b/www/docs.md @@ -516,7 +516,10 @@ Htmx has an extension mechanism that allows you to customize the libraries' beha defined in javascript](/extensions#defining) and then used via the [`hx-ext`](/attributes/hx-ext) attribute: ```html - +
+ + +
``` If you are interested in adding your own extension to htmx, please [see the extension docs](/extensions) diff --git a/www/extensions.md b/www/extensions.md index ae16c118..0d89d1d5 100644 --- a/www/extensions.md +++ b/www/extensions.md @@ -33,6 +33,18 @@ and on the `body` tag for it to apply to all htmx requests. ``` +## [Ignoring Extensions](#ignoring) + +By default, extensions are applied to the DOM node where it is invoked, along with all child elements inside of that parent node. +If you need to disable an extension somewhere within the DOM tree, you can use the `ignore:` keyword to stop it from being used. + +```html +
+ + +
+``` + ## [Included Extensions](#included) htmx includes a set of extensions out of the box that address common developer needs. These extensions are tested