mkhairi / materialize-sass

Materializecss rubygem for Rails Asset Pipeline / Sprockets
http://materialize.labs.my/
MIT License
805 stars 243 forks source link

Buttons click-listener registered multiple times #144

Closed axelerator closed 7 years ago

axelerator commented 7 years ago

I'm not sure if you are aware of the fact that 'turbolinks:load' is triggered on every page change (link click).

https://github.com/mkhairi/materialize-sass/blob/master/app/assets/javascripts/materialize/buttons.js#L2

This means all these on-click-Listeners are registered multiple times. This leads to funny behavior like then 'click-only-fab' only working on every other page.

And I fear it's not the only widget affected by that :-/

mkhairi commented 7 years ago

i can't reproduce this. Everything seems to be working fine. checkout http://materialize-rails.herokuapp.com/components