bigskysoftware / bigskysoftware/htmx
Events htmx:afterRequest / htmx:afterOnLoad not fired in some cases
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
### Problem
The `htmx:afterRequest` and `htmx:afterOnLoad` events are not being fired when the DOM no longer contains the element nor any of its hierarchy.
### Background
I have a popup action menu powered by [tippy](https://atomiks.github.io/tippyjs/v6/getting-started/) that dynamically positions some buttons. These buttons cause htmx requests.

By the time the HTMX request is complete, the entire dom subtree of that menu (including the trigger button) have been removed from the DOM.
This results in `htmx:afterRequest` and `htmx:afterOnLoad` events not being triggered.
### Debugging

Indeed, the trigger's parent hierarchy bottoms (tops?) out without getting to ``.

Contributor guide
Assessment
This issue has not been assessed yet.