I found that for security reason materializecss framework (Release: 1.0.0-alpha.3) is not add ‘active’ class by default in password field to get auto focused.

So it act like overlap label in to autofilled text, when one can not used autocomplete="off"

  <input type="password" autocomplete="off">

But as per the client and business requirement we need to give him as styling as it is a act.

Here is simple CSS that make this fulfil above requirement.

  input:-webkit-autofill + label {
    transform: translateY(-14px) scale(0.8);
    transform-origin: 0 0;
}

Again this is not recommended, however it is safe then the script. as per website requirement sometime we need to do this.

Always try to avoid scripting to give active class to password field this will attract to malware.


69 0 0