-
Notifications
You must be signed in to change notification settings - Fork 643
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Event listener options #1408
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
It’s a shame that to use all the features of browser event handlers, one has to drop out of the happy path syntax and manually initialize/clean up listeners in the
class
— especially if the component would not be stateful otherwise.Why
passive: true
is crucial for smooth scrolling for pages withtouch*
/wheel
handlers — see Default touch/wheel events to passive #1404once
option withonce-eventName
, so that’s coolIt also seems likely that
addEventListener()
will gain more options as the Web platform advances.Possible Implementation & Open Questions
The first thing that jumped to my mind was a second argument to event attributes:
But I can see how the wrapping parentheses are undesirable. It could also look like this with a
handler
prop, which surprisingly has precedent on the Web platform:Is this something you're interested in working on?
Yes
The text was updated successfully, but these errors were encountered: