-
Notifications
You must be signed in to change notification settings - Fork 46.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox: Autocomplete/Autofill not working #17022
Comments
This is because of the difference in the browser's implementation, isn't it? |
@kidkkr: I asume yes! Other user may can test with the js fiddle other browsers and OS too. |
I have checked in Chrome and Mozilla Firefox, Seems to be a bug with Mozilla, |
@abrahamwilliam IF you're using React and link the html value attribute too the React state THEN it stops working |
WorkaroundIf you need the native autofill from Firefox you are currently not allowed to use the attribue Instead you have to use Here is an updated code sample: https://codesandbox.io/s/material-demo-6vhdk export default function ComposedTextField() {
const inputEl = useRef(null);
function handleChange3(event) {
setName3(event.target.value);
}
function handleSubmit(event) {
console.log(inputEl.current.value);
}
<input
id="component-simple3"
ref={inputEl}
autoComplete="on"
onChange={handleChange3}
/> |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
This is still a problem |
I know... I don't know why nobody in the react community is reacting to it! |
Any updates on this? I'm using mui's TextField so there is no way for me to remove the value attribute. Can anybody look at this please? Thanks
|
Since this was closed, I opened a new one: #18986 Maybe this works for you. Sadly, Firefox won't change its behaviour and on the React side, no one reacting ;( |
still an issue in 2022 |
Kool |
Just as an update: Firefox seems to have implemented a fix scheduled for FF 105, see here: You might want to give it a shot 😄 |
There is also a React Fix for it: |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Firefox doesn’t show any autofill suggestions on an input field with type "text" as soon as you connect the state with the attribute "value"
Reproduce
https://codesandbox.io/embed/material-demo-y5mlt
Important: This works corretly in Chrome but not in Firefox!
What is the expected behavior?
Autofill suggestions should be visible in Firefox too!
Autofill is working (FF + Chrome) if value is handled by the browser
Autofill is NOT working (FF) if value is handled by React(!)
Some pictues which show the wrong behavior
It is working as long as React does not handle the value with the state of the component (upper input field):
The input field where React handles the value (
value={name}
) doesn't show autofill suggestionsVersion
The text was updated successfully, but these errors were encountered: