npm-dom / dom-event

Add/remove DOM events
http://npm.im/dom-event
34 stars 7 forks source link

mouseenter and mouseleave don't call listener #9

Open mikkoh opened 9 years ago

mikkoh commented 9 years ago

For some reason 'mouseenter' and 'mouseleave' don't fire their listeners.

In the following example in chrome only el.addEventListener fires.

on( el, 'mouseenter', function() {

  console.log( 'dom-event' );
});

el.addEventListener( 'mouseenter', function() {

  console.log( 'addEventListener' );
});
mattdesl commented 9 years ago

weird, I'm seeing this too. mouseover works fine btw.

After struggling to figure out the riddle of ternaries and shorthand in the index.js, I think the problem is because the addEventListener is not scoped to the element.