bigskysoftware / bigskysoftware/htmx

Add Hx-Swap header to the request

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

Description

I have a situation where I want to change the behavior of my response to the client depending on the swap attribute.

I'm trying to develop a framework that uses HTMX and the user can define everything that is available in HTMX. This means that I can only know at the time of the request if the content should be swapped completely or if its only a partial replacement of the element.

It would make my life easier if the request also had an header like Hx-Target but with the swap value like Hx-Swap.

Edit: I've changed it to be an implementation in the getHeaders function and changed it according to the feedback from @scrhartley
[Fork dev branch](https://github.com/Declow/htmx/tree/add-hx-swap-header)

What do you think? Do you want to support this feature?

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.