Topic: 4.4: Issues with manual initializing of components

benny pro asked 7 years ago


When you're working with an Frontend Framework with routing and building a single page application, you need to initialize components your own with each route transition. I'm working with ember and in my router.js I did

Materialize.updateTextFields();
WOW.init();
// ...

to initialize dynamically created input fields and wow animations. The Materialize.updateTextFields() method not available in 4.4 anymore and the initialization of WOW doesn't have any effect (first page works, after route transition the wow elements don't appear). Whats the new way to accomplish that?


benny pro commented 7 years ago

I already found a solution for WOW.js: var wow = new WOW({ live: false }); wow.init(); But the problem with the inputs/labels still exists.

benny pro commented 7 years ago

Workaround is to change the mdb.js and add "window.updateTextFields = () => {" before line 14050 and " }; window.updateTextFields(); " after line 14086. So you can call window.updateTextFields(); to init the labes but that's just a dirty patch.

Marco Castignoli free commented 6 years ago

Did you find a solution?

Jakub Strebeyko staff commented 6 years ago

hi Marco, What exactly you'd like assistance with? There are two issues mentioned in this ticket and both find their instant fixes (dirty patches if you may) while search for more graceful solutions is underway. With Best Regards, Kuba

tofesu free commented 1 year ago

in materialize.js M.updateTextFields = function () { var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea'; $(input_selector).each(function (element, index) { ....

change order to function(index,element)


Edyta Dabrowska free answered 7 years ago


Thank you for reporting this. We will test it and consider fixing this in the future.

jhobeck free commented 6 years ago

When will this be fixed? We have purchased the PRO version and we cannot release our application to production with this defect. Our entire site would be unusable.

Mikołaj Smoleński staff commented 6 years ago

Did You try to add below code to Your scripts? var wow = new WOW({ live: false }); wow.init();


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags