Skip to content
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

Enable passive and once options when adding listeners to Components, Custom Elements and Shadow Roots #420

Closed
caridy opened this issue Jun 15, 2018 · 3 comments

Comments

@caridy
Copy link
Contributor

caridy commented Jun 15, 2018

Because of the fallback mechanism in the synthetic shadow, we need to queue the listeners adding to Components, Custom Elements and Shadow Roots, and because of that queue, we can't support passive or once options.

We should attempt to solve this at some point. The workaround is to add those manually in renderedCallback() on a regular element in your template, or on the slot element, and by doing so, you can use the options there. Keep in mind that this also requires some branch check to avoid adding that multiple times since renderedCallback() is invoked after every render.

@diervo
Copy link
Contributor

diervo commented Jun 15, 2018

We will need this soon since safari just moved to support passive this release as the default

@caridy
Copy link
Contributor Author

caridy commented Jul 5, 2018

A question here diego is that if events defined via template syntax are always going to be passive, which I think makes sense, and if they want to make it not-passive, then they can always call the programatic api addEventListener in the renderedCallback

@caridy caridy added this to the 220 milestone Nov 23, 2018
@ravijayaramappa ravijayaramappa removed this from the 220 milestone Feb 12, 2020
@pmdartus
Copy link
Member

pmdartus commented Feb 5, 2021

Dupe of #1824.

@pmdartus pmdartus closed this as completed Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants