-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
ElementEvents.subscribe set useCapture to true by default, which is not standard #657
Comments
@sebastien-roch I've been hit by this as well. It's unfortunate, but we can only fix this in a major release of templating. |
Sadly, we can't change it at this point because it could potentially break existing apps. What if we had some setting that could be set to get the desired behavior though, in a non-breaking way? |
@EisenbergEffect We cna do that via a static field on |
That works for me. @sebastien-roch Would you be interested in adding this property and updating the implementation to use it? I think it would make a fine contribution and we'd be very happy to work with you to get your PR in. Thoughts? |
I can do that. Towards which branch should I target my pull request having this |
@sebastien-roch Thanks for that. It should be |
…t default options when subscribing to events ElementEvents.subscribe will set capture to true be default if not explicitely passed in argument. This is not the standard behavior of the native addEventListener() and confuses developers. This new options let you define the default behavior. Fixes issue #657
I'm submitting a bug report
Library Version:
master
Language:
all
Current behavior:
When using
EventElements.subscribe
, the listener will be set withuseCapture = true
, which is not the standard behavior of the nativeaddEventListener()
function and thus confuses the developer.What is the expected behavior?
EventElements.subscribe
(and subscribeOnce) should use setuseCapture
tofalse
by default.What is the motivation / use case for changing the behavior?
Mimic native API of the browser: addEventListener would set
useCapture
tofalse
if not passed in arguments.The text was updated successfully, but these errors were encountered: