You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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 <body>.
The text was updated successfully, but these errors were encountered:
Ramblurr
changed the title
Events afterRequest / afterOnLoad not fired in some cases
Events htmx:afterRequest / htmx:afterOnLoad not fired in some cases
May 15, 2024
Problem
The
htmx:afterRequest
andhtmx: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 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
andhtmx:afterOnLoad
events not being triggered.Debugging
Indeed, the trigger's parent hierarchy bottoms (tops?) out without getting to
<body>
.The text was updated successfully, but these errors were encountered: