madrobby / zepto

Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API
http://zeptojs.com
Other
14.99k stars 3.91k forks source link

mouseenter / mouseleave events fail when bound with selector #977

Open benwick opened 10 years ago

benwick commented 10 years ago

If you use the mouseenter / mouseleave events without a selector in the on-method, they will function as expected. If you use them with a selector, they will fail and loose all its magic :(

http://jsfiddle.net/6q7Hn/

Here is a small fiidle to demonstrate the case. Look at the console output: when you enter the inner white box, the selector bound event will fire a mouseleave, which is an undesirable behaviour.

mislav commented 10 years ago

Yes, this is a problem with our current implementation of mouseenter/mouseleave: it gets overriden by event delegation.

Right now it's not possible to combine the two, but we'll look into fixing this.

RodeyManager commented 10 years ago

"Uncaught TypeError: undefined is not a function " => touch.js ( line 57 )

henryruhs commented 9 years ago

Using on('mouseenter mouseleave') returns the event.type mouseover and mouseout... this is weird - works perfect in jQuery and jBone

RodeyManager commented 8 years ago

OK, thanks!