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

Support Passive Event Listeners #377

Open
mciparelli opened this issue Sep 21, 2016 · 7 comments
Open

Support Passive Event Listeners #377

mciparelli opened this issue Sep 21, 2016 · 7 comments

Comments

@mciparelli
Copy link
Collaborator

It would be nice to have support for passive events.
Related: facebook/react#6436

@Havunen
Copy link
Member

Havunen commented Sep 21, 2016

Currently Inferno adds events using inline way. equivalent to:

<div onclick="function() {}"></div>

To support this feature new way of handling methods is needed. We used to use addEventListener, but that resulted memory leaks and slow rendering because of removeEventListener (to avoid that leak).

@trueadm
Copy link
Member

trueadm commented Dec 4, 2016

@Havunen this is now a possibility again with our new event system.

@trueadm
Copy link
Member

trueadm commented Dec 23, 2016

Let's revisit this post 1.0.

@trueadm
Copy link
Member

trueadm commented Dec 23, 2016

Add to roadmap @lukeed

@trueadm trueadm closed this as completed Dec 23, 2016
@Havunen Havunen reopened this Apr 11, 2017
@Havunen
Copy link
Member

Havunen commented Apr 11, 2017

Re-opening as this was never implemented

@sprlwrksAprilmintacpineda

This looks good, this would have effects in performance. But as far as I have read, this would only be applicable for events that's related to scrolling --> https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners. Inferno could handle it by supporting event options like so:

<span onScroll={{
  handler (ev) {
    // do something
  },
  options: {
    passive: true
  }
}}>

OR adding it automatically when the event listener is related to scrolling.

There's even a demo video about this --> https://youtu.be/65VMej8n23A

@aprilmintacpineda
Copy link

I think it's good for inferno to support passive listener for onScroll by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants