I am currently working on a login modal and have encountered an issue with styling input tags for browser autocomplete. Despite my efforts to reset the User Agent Stylesheet styling, the old styling reappears whenever autocomplete is triggered.
Below is a simplified version of my react login form:
<form id="login-popup-container">
<div className="login-field-container">
<div className="login-value-title user">email</div>
<input className="answer login-info" type="text" />
</div>
<div className="login-field-container">
<div className="login-value-title password">password</div>
<input className="answer login-info" type="password" />
</div>
</form>
In my index.css file, I have included the following styles:
input, input:focus, input:active, input:hover, input:-webkit-autofill, input:autofill, input:indeterminate, input:enabled, input:valid {
outline: none !important;
border:none !important;
background-image:none !important;
background-color:transparent !important;
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow: none !important;
}
While this solution works in a chrome incognito browser as intended.
However, when using a regular chrome tab and triggering autofill, the User Agent Stylesheet styling returns to the input elements like shown here. I have attempted various pseudo-classes to reset the input tag styling but without success.
Has anyone else encountered this issue or knows why it occurs?