Add a Materialize.init() function
See original GitHub issueTurbolinks is ruby gem massively used by Ruby on Rails applications. It intercepts each get request, fetches the content and swaps is without doing the full page reload.
Since document ready is not triggered after the content is dynamically swapped, materialize js is not initialized.
Since turbolinks offer custom events, problem could be easily solved if there is a nice and simple way to dynamically initialize js modules. Something like Materialize.init()
. It can then be internally called on document ready, but would further allow developers to manually initialize them whenever needed.
I’m sure that turbolinks are just one example and that there are many more cases where this issue arises.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Auto Init - Materialize
Auto Init allows you to initialize all of the Materialize Components with a single function call. It is important to note that you...
Read more >Initializing Materialize functions - javascript - Stack Overflow
I am having trouble initializing some Materialize-css ...
Read more >Angularjs directives for Materialize CSS Framework
It includes a number of directives, which makes sure that the components in materialize.js, which are mainly initialized on document ready, are handled...
Read more >Modals with Materialize - Michael Jan Schiumo - Medium
In our App.js file, we need to import 'M' from Materialize, which will allow us to use methods like AutoInit() for initializing Materialize...
Read more >Materialize CSS Crash Course [Part 2] - JavaScript Widgets
In this second part of the Materialize crash course, we will look at the JavaScipt widgets included in the framework.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The event listener should also fire for dynamically added elements.
Added to the feature request board