htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Event not set for "special" events

Open mikaelho opened this issue 4 years ago • 1 comments

I have server endpoint that I need to process several different events. For this to work I am using the event-header extension. It works fine except for the special event load.

Looking at the code I see that the extension is dependent on the triggeringEvent information received from the main code. There it looks like reveal (in maybeReveal) and load (in loadImmediately) do not pass the event parameter to issueAjaxRequest, because there is no event to pass, I guess.

Currently I work around this by assuming that if I do not get the event info, it is a load, but obviously this is not ideal, and I will run into trouble as soon as I want to utilise reveal.

Would it be possible for the methods above to pass a minimum viable "event", e.g. {type: "load"} to issueAjaxRequest?

mikaelho avatar Sep 09 '21 14:09 mikaelho

Definitely a bug. Will try to get it fixed for the next release.

1cg avatar Nov 02 '21 22:11 1cg