anvaka / ngraph.events

Events support in ngraph.*
BSD 3-Clause "New" or "Revised" License
18 stars 9 forks source link

Passive Event listeners #1

Closed gg4u closed 5 years ago

gg4u commented 5 years ago

Hi, Chrome extensions display a warning for event listeners:

https://www.chromestatus.com/feature/5745543795965952

In the built code of vivagraph adding the object {passive: true} to lines:

element.addEventListener('mousedown', handleMouseDown, {passive: true});
element.addEventListener('touchstart', handleTouchStart, {passive: true});

will work.

I read it calls events from ngraph.events, but did not understand where to pass the object.

what does ctx mean in line:

handlers.push({callback: callback, ctx: ctx});

Where should {passive: true} be added in the build of Vivagraph to comply with https://www.chromestatus.com/feature/5745543795965952 ?

anvaka commented 5 years ago

This library doesn't use dom events - it's just a basic javascript code. Please let me know if you need this fixed in vivagraph (it would also be better to place this issue there).