IjzerenHein / famous-flex

Animatable layouts, FlexScrollView & widgets for famo.us.
MIT License
279 stars 44 forks source link

FastClick issue with "famous-Starterkit" #80

Closed mutazmq closed 9 years ago

mutazmq commented 9 years ago

Using FastClick: When I run my project in "famous-Starterkit", which uses Webpack, the "click" event handler fires twice. One for MouseEvent and the other for CustomEvent

However, when I remove AMD define from famous-flex and use Browserify, I don't get the same problem and click event handler fires once on CustomEvent object .

Has anyone experienced the same issue?

Thanks Mutaz

IjzerenHein commented 9 years ago

Hi, I'm unable to reproduce this with the Starterkit. I installed a click-handler on a surface, and it's only firing once. Could you dump the callstack for both click events here?

mutazmq commented 9 years ago

Hi, here we go: http://paste.ofcode.org/hbFDbSGX7hAkFgKEsjdHrL http://paste.ofcode.org/vhGDP9HE5cwh7VEamTWa5T

I solved it by using ftlabs FastClick instead of Famo.us's one

IjzerenHein commented 9 years ago

Yes that's right, the famo.us FastClick implementation doesn't work correctly, that's why the famous-Starterkit uses the ftlabs version as well.

mutazmq commented 9 years ago

BTW, this issue comes only when I use Webpack. Using Browserify, I can use famous FastClick without any trouble

IjzerenHein commented 9 years ago

My hunch is that the Browserify version actually breaks an event-chain, making it accidentally work.