Comments (3)
I avoid this issue using materialize via yarn.
$ yarn add materialize-css@next
# config/initializers/assets.rb
Rails.application.config.assets.paths << Rails.root.join('node_modules')
and the following changes:
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index 4c2840f..b883b74 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -1,3 +1,3 @@
-//= require materialize-sprockets
+//= require materialize-css/dist/js/materialize
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index b04947c..6b2bca1 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -1,8 +1,8 @@
-@import 'materialize';
+@import 'materialize-css/sass/materialize';
from materialize-sass.
I can confirm that newer versions of materialize-sass aren't working correctly. The events are created during the first page visit but are lost when navigating away and coming back (I've checked and turbolinks picks it up fine, fires the initialization scripts but modals etc. are not working).
application.js
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require materialize-sprockets
//= require_tree .
init.coffee
window.App ||= {}
App.init = ->
$('.button-collapse').sideNav()
$('.dropdown-button').dropdown()
$('.collapsible').collapsible()
$('.tooltipped').tooltip({ delay: 50 })
$('.modal').modal()
$('select').material_select()
$(document).on('turbolinks:load', ->
App.init()
)
Last working version of materialize sass is 0.97.8
from materialize-sass.
one thing you can do is reset the count before initializing it.
from materialize-sass.
Related Issues (20)
- QUESTION: Using turbolinks causing sideNav issues with browsers back action HOT 1
- Thumb with the range is out of view HOT 1
- Support v1.0.0-beta HOT 2
- helper-text styling is off HOT 2
- Usage step A causing "Fail to import not found or unreadable" HOT 6
- sideNav is not a function HOT 2
- Why no helpers? HOT 2
- undefined variable HOT 1
- Forms are broken in 1.0.0.rc2 HOT 3
- $map: #007bff is not a map for `map-has-key' HOT 4
- Sidenav-overlay active with sidenav-fixed HOT 3
- not upgraded the gem version yet HOT 1
- Navbar module not working.... HOT 3
- update materialize.js HOT 1
- How do I access the Materialize 'M' backup? HOT 1
- Rails Webpacker HOT 3
- DatePicker closes immediately when clicked on in Chrome HOT 3
- Warning when using Rails 6 zeitwerk autoloading
- Publish new release? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialize-sass.