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.

[TextField] Autofill detection not working in production

See original GitHub issue

In production, the TextField label is not shrunk when using autofill: image

Demo: https://jsfiddle.net/284y3evu/ Steps to reproduce:

  1. Fill in the form and click submit.
  2. Choose to save the password in browser.
  3. Go back in the iframe, or refresh the page.
  4. Use the autofill.

It works fine with development bundles. Same demo, with only Emotion and Material-UI changed to development versions: https://jsfiddle.net/284y3evu/1/

The cause of this issue seems to be that in production the @keyframes mui-auto-fill declaration is removed from the styles. Adding some styles to the keyframes (InputBase.js:488) fixes the issue, for example:

<GlobalStyles
    styles={{
        '@keyframes mui-auto-fill': { '100%': { display: 'block' } },
        '@keyframes mui-auto-fill-cancel': { '100%': { display: 'block' } },
    }}
/>

But perhaps there’s a better solution. Maybe somthing can be changed in Emotion configuration.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
michal-perlakowskicommented, Aug 24, 2021

@eps1lon This is a different issue. My issue is about the shrunk state of the label, and the linked issue is about onChange event handler.

2reactions
eps1loncommented, Aug 24, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

[TextField] Autofill detection not working in production #26449
In production, the TextField label is not shrunk when using autofill: Demo: https://jsfiddle.net/284y3evu/ Steps to reproduce: Fill in the form and click ...
Read more >
Why credit card autofill doesn't work when production build but ...
I have a very simple form in my react application to fetch the user credit card information as follows. <form autocomplete="on"> <input class=" ......
Read more >
Autofill - web.dev
This module teaches you how autofill works, and how autocomplete and other element attributes can ensure that browsers offer appropriate autofill options. How ......
Read more >
352347 - Don't autofill passwords where confirmation is required
Detecting multiple password fields does not solve the problem. Some admin interfaces provide only one password field to change/set a password.
Read more >
How to detect browser autofill using JavaScript?
Here we are going to use 3 programming languages HTML, CSS, Jquery to solve this problem in the best and well-defined way. In...
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