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.

Floating labels for Password inputs not triggering on Chrome auto-fill

See original GitHub issue

When using the following input code, floating labels aren’t triggering on auto-fill for the Password inputs (they’re working fine for text inputs) :

<div class="login__form">
  <div>
    <mdl-textfield floating-label [(ngModel)]="username" [label]="'Username'" name="__ac_name"></mdl-textfield>
  </div>
  <div>
    <mdl-textfield floating-label [(ngModel)]="password" [label]="'Password'" type="password" name="__ac_password"></mdl-textfield>
  </div>
</div>

Screenshot: screen shot 2017-08-25 at 2 15 21 pm

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
zucker-rdrgcommented, Sep 20, 2017

This workaround works for me:

input:-webkit-autofill ~ .mdl-textfield__label {
  top: $input-text-vertical-spacing - ($input-text-floating-label-fontsize + $input-text-padding);
  color: $input-text-highlight-color;
  font-size: $input-text-floating-label-fontsize;
}
1reaction
pmayur25commented, Apr 10, 2018

I used Material design Bootstrap (MDB) below code is working for me

$(document).ready(function () { setTimeout(function () { var $Input = $(‘input:-webkit-autofill’); $Input.next(“label”).addClass(‘active’); }, 200); });

Read more comments on GitHub >

github_iconTop Results From Across the Web

label not floating when the browser using password manager ...
i have a login form. The password label not floating when the browser using password manager auto completion. Here's the preview. Thanks (input...
Read more >
Labels not aligning correct when using autofill in chrome
When I'm entering text in an input field the floating labels are acting weird when using autofill in chrome compared to typing in...
Read more >
CSS floating labels - Chrome autofill : r/web_design - Reddit
Hi All,. Been struggling on an issue for a few days now and kept putting it to the back of the pile but...
Read more >
352527 - Autofill should trigger a change event on inputs
Now navigate to the page and you'll see that the username field has the correct label floating above but the password field does...
Read more >
Detecting Chrome autofill on page load - Medium
The floating labels are “floated” when input is focused or when there's a value in ... Well, not so much when it comes...
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