bigskysoftware / bigskysoftware/htmx

beforeSwap and afterSwap events should also log hx-swap setting

Open
#2,303 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

The beforeSwap and afterSwap events when logged to the console don't contain the actual (inherited) `hx-swap` setting.

I was debugging an expected swap that didn't occur. I added logging to the console as [described here](https://htmx.org/docs/#logging).

AJAX response was correct, target was correct, isError = false, shouldSwap = true, failed = false, succesful = true, as shown here:
image

It didn't occur to me that I should explicitly set the `hx-swap="innerHTML"` attribute since that is the default. But I didn't know `hx-swap="none"` was set on the `` tag and it was inherited to the whole DOM tree.

If `hx-swap: 'none'` would have been reflected in the log, I would have caught and fixed the issue much earlier.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.