Disable Chrome autofill allowing autoComplete="new-password" to be passed into the Input component properties
See original GitHub issueCurrently, the default Input component is forcefully setting autoComplete="off"
which doesn’t disable Chrome’s autofill functionality on latest browser versions. For achieving that, we need to pass autoComplete="new-password"
.
The problem is that the value is hardcoded and can’t be configured unless we implement our own Input component and configure this property properly there.
It’s hardcoded here: https://github.com/JedWatson/react-select/blob/ba76246a92fe9371b5d4f8795d30119b045dcaba/src/Select.js#L1401
And it gets passed to the default Input component here: https://github.com/JedWatson/react-select/blob/ba76246a92fe9371b5d4f8795d30119b045dcaba/src/components/Input.js#L53
As you can see, there’s no way of configuring that property manually.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:16
Top Results From Across the Web
html - Disabling Chrome Autofill - Stack Overflow
Just use <form autocomplete="off"> and it prevents the password prefilling as well as any kind of heuristic filling of fields based on assumptions...
Read more >How to turn off form autocompletion - Web security | MDN
This article explains how a website can disable autocomplete for form fields.
Read more >How to Disable the Browser Autocomplete and Autofill on ...
Learn how to prevent browsers auto filling the input fields of HTML forms. Use autocomplete="off" to specify that autocomplete is disabled. See examples....
Read more >React Autocomplete component - Material UI - MUI
The autocomplete is a normal text input enhanced by a panel of suggested options. The widget is useful for setting the value of...
Read more >914451 - Autofill does not respect autocomplete="off" - Monorail
Chrome will respect autocomplete="no" ...but not "off" ..however, you are unable to set it to "no" except in the developer console, because the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
@rdsedmundo Yes, there is a possibility to configure it. It is hard coded as a prop to the
Input
component, that is true. But this library offers in its current version the possibility to overwrite its internal components using its components framework.You just have to overwrite the
Input
component and overwrite the prop being passed to the component.@kylehurt-rkv Here is your native support, without forking the repository.
Seems like there’s a good reason to have this
autoComplete
configurable, as based on the age and responses of https://github.com/JedWatson/react-select/pull/2395