Giter Club home page Giter Club logo

Comments (3)

tricknotes avatar tricknotes commented on May 25, 2024

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.

kkarski82 avatar kkarski82 commented on May 25, 2024

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.

geniuskidkanyi avatar geniuskidkanyi commented on May 25, 2024

one thing you can do is reset the count before initializing it.

from materialize-sass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.