question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Class 'active' not added, when autofill is used

See original GitHub issue

two forms

<form action="" class="col s12" method="post" accept-charset="utf-8">
    <div class="row">
        <div class="input-field col s12" style="margin-bottom: 10px;">
            <i class="mdi-action-account-circle prefix"></i>
            <input type="text" name="identity" value="" class="validate" id="icon_prefix" required="required" style="margin-top: 0.5rem;"  />
            <label for="icon_prefix" style="margin-left: 3.5rem;" class="active">Номер телефона или e-mail</label>
        </div>
        <div class="input-field col s12">
            <i class="mdi-action-lock-outline prefix"></i>
            <input type="password" name="password" value="" class="validate" id="icon_password" required="required" style="margin-top: 0.5rem;"  />
            <label for="icon_password" style="margin-left: 3.5rem;" class="active">Пароль</label>
        </div>
        <div class="input-field col s6">
                <button class="btn cyan waves-effect waves-light right" type="submit" name="action"><i class="mdi-action-lock-open"></i> Войти</button>

        </div>
    </div>
</form> 

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Dogfalocommented, Feb 28, 2018

This problem seems to have been fixed in recent versions of Chrome and Firefox

2reactions
WhileLoopcommented, Mar 12, 2018

Fixed by adding:

input:-webkit-autofill + label {
  -webkit-transform: translateY(-14px) scale(0.8);
  transform: translateY(-14px) scale(0.8);
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

autofill - CSS: Cascading Style Sheets - MDN Web Docs
The :autofill CSS pseudo-class matches when an <input> element has its value autofilled by the browser. The class stops matching if the user ......
Read more >
jQuery UI Autocomplete: set active item - Stack Overflow
Save this question. Show activity on this post. I am trying to micmic teh behaviour of a simple HTML SELECT element with jQuery...
Read more >
autofill - CSS-Tricks
The :auto-fill pseudo-class in CSS allows us to style <input> elements that contain content auto-filled by the browser.
Read more >
Detecting autofilled fields in Javascript | by Tommy Brunn
This is done by listening for a change event and adding the class is-filled to the field, which then applies the appropriate zooming...
Read more >
How To Add Active Class To Current Element - W3Schools
className += " active"; }); }. Try it Yourself ». If you do not have an active class set on the button element...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found