htmx icon indicating copy to clipboard operation
htmx copied to clipboard

HX-Trigger "Revealed" doesn't work with other triggers.

Open Lorenzmueller2 opened this issue 1 year ago • 1 comments

If you use hx-trigger="revealed" the trigger works, when scrolled into view, but when you use revealed with another trigger event, for example: hx-trigger="revealed, myCustomEvent from:body" it doesn't trigger the revealed event.

We searched through the code and found the reason.

https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L1581

It checks if hx-trigger is exactly "revealed" and not contains the event "revealed".

Is it a bug or, if it was done on purpose?

Lorenzmueller2 avatar Feb 08 '24 17:02 Lorenzmueller2

Hey, that was recently tracked down by another user who opened this PR. :)

May take a while due to the approaching v2 release, I guess.

andryyy avatar Feb 08 '24 19:02 andryyy