css - Make materialize labels move out of input box when input box is filled via javascript -


normally, materialize, labels text input boxes show inside input boxes until user enter selects box , enters text in it. however, when box's value filled via javascript, label not move out of way. stays in box , overlaps text entered. there way trigger label transition javascript well, doesn't happen?

more specifically, if using materialize in rails turbolinks enabled, find materialize form fields prefilled non-empty values not active on page load.

the following method worked me:

$(function() {     materialize.updatetextfields(); }); 

it add class 'active' both corresponding labels , prefix icons.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -