htmx icon indicating copy to clipboard operation
htmx copied to clipboard

fix: Fire htmx:trigger event on delayed triggers

Open WKBae opened this issue 2 years ago • 3 comments

Description

hx-trigger with delay modifier did not fire htmx:trigger event. This behavior was inconsistent with plain(non-delay) events. Demo: https://jsfiddle.net/yu59noed/

Testing

Added test case for delayed htmx:trigger. This test case failed on current dev branch.

Checklist

  • [x] I have read the contribution guidelines
  • [x] I have targeted this PR against the correct branch (master for website changes, dev for source changes)
  • [x] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
  • [x] I ran the test suite locally (npm run test) and verified that it succeeded

WKBae avatar Mar 18 '24 11:03 WKBae

Hi @WKBae I just found the same inconsistency and found your fix for that is already in the pipeline! Good work! However it seems your fix could also cover the throttle modifier as looking at the code, few lines above your fix, it seems it suffers from same omission.

Thanks in any case! :)

zoladkow avatar Apr 08 '24 15:04 zoladkow

good fix, please retarget to dev

1cg avatar May 15 '24 18:05 1cg

@1cg Oh I forgot to change it. Thanks for the reminder!

WKBae avatar May 16 '24 13:05 WKBae

Hey @WKBae , are you still interested in that change ? If so, please rebase to dev and resolve conflicts, thanks!

Telroshan avatar Jul 22 '24 17:07 Telroshan

Hi @Telroshan, I've rebased the branch to current dev.

WKBae avatar Jul 26 '24 08:07 WKBae

I have merged this change and @zoladkow i added the event for throttled events as well

1cg avatar Aug 05 '24 19:08 1cg