-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to add options
argument to event listener
#2836
Conversation
options
argument to event listener
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDoc seems perfectly fine to me!
Note that I'll remove the "ready for review" label for now; despite its generic name, we actually use this label just for 1cg, to tag PRs that are ready for his final review, meanwhile you can simply ping me for any update! Hit me up when you figure out this |
Apologies, I hadn’t realised that.
I’m just learning about it too, but in doing so I’m realising that there’s little or no value in us testing that the Note also that the |
No worries, it isn't written anywhere and has been an implicit convention between us, you couldn't know!
Well, I agree on this, As you have a test for Besides, With that, back to ready for review! |
Merci! |
great change ben! |
This PR adds the ability to add an
options
(oruseCapture
) argument to the event listener when usinghtmx.on()
.As per the
addEventListener()
method spec, the third argument accepts anoptions
object or auseCapture
boolean.Usage:
Note to the reviewer: please double check my JSDoc annotations, I think they’re accurate but I’m not 100% sure.
Testing
I added a test that verifies that the
options
argument is respected.htmx/test/core/events.js
Lines 80 to 93 in b266104
Checklist
master
for website changes,dev
forsource changes)
This is either a bugfix, a documentation update, or a new feature that has been explicitlyThis is a minor addition to an existing feature, not pre-approved 😬approved via an issue
npm run test
) and verified that it succeeded