[TextField] Autofill detection not working in production
See original GitHub issueIn production, the TextField label is not shrunk when using autofill:
Demo: https://jsfiddle.net/284y3evu/ Steps to reproduce:
- Fill in the form and click submit.
- Choose to save the password in browser.
- Go back in the iframe, or refresh the page.
- 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:
- Created 2 years ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
Duplicate of https://github.com/mui-org/material-ui/issues/22488