summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/htmx/htmx-assets.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/misc/htmx/htmx-assets.js')
-rw-r--r--core/misc/htmx/htmx-assets.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/misc/htmx/htmx-assets.js b/core/misc/htmx/htmx-assets.js
index bc5f00df432..9175405d047 100644
--- a/core/misc/htmx/htmx-assets.js
+++ b/core/misc/htmx/htmx-assets.js
@@ -166,7 +166,8 @@
// @see https://htmx.org/events/#htmx:afterSettle
htmx.on('htmx:afterSettle', ({ detail }) => {
requestAssetsLoaded.get(detail.xhr).then(() => {
- htmx.trigger(detail.elt, 'htmx:drupal:load');
+ // Some HTMX swaps put the incoming element before or after detail.elt.
+ htmx.trigger(detail.elt.parentNode, 'htmx:drupal:load');
// This should be automatic but don't wait for the garbage collector.
requestAssetsLoaded.delete(detail.xhr);
});