feat: add hold as a trigger event modifier
Description
Please describe what changes you made, and why you feel they are necessary. Make sure to include code examples, where applicable.
adds hold as a trigger event
Corresponding issue:
None, I wanted to create a hold-to-click interaction and realized how common of a pattern it is, so I decided to take a stab at upstreaming it into HTMX
old PR :: https://github.com/bigskysoftware/htmx/pull/3438
Testing
Please explain how you tested this change manually, and, if applicable, what new tests you added. If you're making a change to just the website, you can omit this section.
I tried to test as many edge cases as I could, if any reviewer comes up with more, I can try adding those too. :)
Checklist
- [y] I have read the contribution guidelines
- [y] I have targeted this PR against the correct branch (
masterfor website changes,devfor source changes) - [n] This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
- [y] I ran the test suite locally (
npm run test) and verified that it succeeded
I was recommended by latent3611 on the Discord server to make a sample extension as well
https://github.com/81reap/htmx-ext-hold