HTMX 4
When the following option is set like so:
htmx.config.defaultSwap = "none";
The solution I've got to work is the following.
document.addEventListener('htmx:config:request', (evt) => {
const ctx = evt.detail.ctx;
if (ctx.request.headers['HX-History-Restore-Request'] === 'true') {
}else{
ctx.swap = 'none';
}
});