When using the idiomorph-ext extension with htmx, setting hx-swap to "morph:outerHTML" doesn't properly recognize and apply new hx-trigger attributes from the fetched content.
On swapping, the newly fetched content's hx-trigger attribute should be respected and its behavior should be applied.
Causing this component to load poll.
Actual Behavior:
The hx-trigger is not applied to the newly fetched content so the content does not poll.
Additional Information:
If the original element has a hx-trigger of "every 1s", then that trigger will still be active post-swap.
Description:
When using the
idiomorph-ext
extension withhtmx
, settinghx-swap
to "morph:outerHTML" doesn't properly recognize and apply newhx-trigger
attributes from the fetched content.Reproduction:
LIVE EXAMPLE: https://clever-clam-66.deno.dev/ GITHUB: https://github.com/HenryMorgan-cd2/htmx-idiomorph-swap-bug
Expected Behavior:
On swapping, the newly fetched content's
hx-trigger
attribute should be respected and its behavior should be applied. Causing this component to load poll.Actual Behavior:
The hx-trigger is not applied to the newly fetched content so the content does not poll.
Additional Information:
If the original element has a hx-trigger of "every 1s", then that trigger will still be active post-swap.