Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

materialize turbolink select bug #6290

Open
thiaguerd opened this issue Feb 13, 2019 · 2 comments
Open

materialize turbolink select bug #6290

thiaguerd opened this issue Feb 13, 2019 · 2 comments

Comments

@thiaguerd
Copy link

Project: https://github.com/thiaguerd/materialize_turbolink_select_bug

I have a select on page http://localhost:3000/home/about

when I come to page using browser button back or next a select bug, duplicate himself a each time that I a go in page

demo

@jbd0101
Copy link

jbd0101 commented Feb 13, 2019

if you do something like this ?

<script type="text/javascript">
	$(document).on('turbolinks:load',function(){
             $('select').formSelect();
        })
</script>

you have written 2 times the same command ....

if you use jquery and turbolinks you have to replace $(document).ready(....) by $(document).on('turbolinks:load',function(){ /* your code */ })

jc

@thiaguerd
Copy link
Author

Sorry, was a test. I forgot to remove
Using only

$(document).on('turbolinks:load',function(){$('select').formSelect();})

Not work

Using only

$(document).ready(function(){$('select').formSelect();});

Not work too

I try everything, believe me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants