From 10f45c321ed4e978d7b0e1ccedd331e30a3e67ac Mon Sep 17 00:00:00 2001 From: Christopher Jefferson Date: Tue, 9 Jul 2024 01:50:17 +0800 Subject: [PATCH] Clarify that hx-trigger:from doesn't dynamically update (#2696) * Fix typo * Clarity that 'from' doesn't update as the page changes --- www/config.toml | 2 +- www/content/attributes/hx-trigger.md | 1 + www/content/docs.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/www/config.toml b/www/config.toml index 9d695528..2b3e2838 100644 --- a/www/config.toml +++ b/www/config.toml @@ -4,7 +4,7 @@ theme = "htmx-theme" compile_sass = false build_search_index = false -generate_feed = true +generate_feeds = true taxonomies = [ { name = "tag", render = false, feed = true }, diff --git a/www/content/attributes/hx-trigger.md b/www/content/attributes/hx-trigger.md index ec5f1762..6be72748 100644 --- a/www/content/attributes/hx-trigger.md +++ b/www/content/attributes/hx-trigger.md @@ -56,6 +56,7 @@ is seen again it will reset the delay. is seen again before the delay completes, it is ignored, the element will trigger at the end of the delay. * `from:` - allows the event that triggers a request to come from another element in the document (e.g. listening to a key event on the body, to support hot keys) * A standard CSS selector resolves to all elements matching that selector. Thus, `from:input` would listen on every input on the page. + * The CSS selector is only evaluated once and is not re-evaluated when the page changes. If you need to detect dynamically added elements use an event filter, for example `click[event.target.matches('input')]` * The extended CSS selector here allows for the following non-standard CSS values: * `document` - listen for events on the document * `window` - listen for events on the window diff --git a/www/content/docs.md b/www/content/docs.md index bc1645c6..814cacc5 100644 --- a/www/content/docs.md +++ b/www/content/docs.md @@ -246,7 +246,7 @@ issuing the request. If the event triggers again, the countdown is reset. * `throttle: