Material-ui: Disabling autofill on inline text

Created on 25 Dec 2015  路  17Comments  路  Source: mui-org/material-ui

something like autocomplete = off on for html would be just as cool/useful for 's I think. Unless you can already do it, but I don't see it in the docs.

Autocomplete by chrome can make it look kind of bad sometimes with certain styling.

enhancement

Most helpful comment

Just an FYI, Google Chrome seemed to not care if I set autoComplete="off" or not, it would always provide an autocomplete... If I set it to autoComplete="no", it worked.

All 17 comments

In jsx autocomplete = autoComplete

<AutoComplete
    dataSource={cities}
    ...
    autoComplete='off'
/>

derp thank you

Notice that you do no longer need to provide the autoComplete='off' for the AutoComplete component on the master branch. It's added by default.

This is not working for a normal TextField because you can't pass in custom attributes autoComplete='off' just does nothing.

How can I set autocomplete=off on the input-element?

@chapati23 in the latest version works well

<TextField
  autoComplete='off'
  floatingLabelText="From"
 ...
/>

renders to:
screen

You can see in the source code

apologies, you are correct. must have been either a typo or caching issue on my side, just tried again and it works fine.

@chapati23 that's ok 馃槂

I still have issue with that, when I provide the autoComplete ='new-password ' to TextField, react renders it to input, but they still propose to autofill password that I saved.

@palaniichukdmytro Confirmed

Just an FYI, Google Chrome seemed to not care if I set autoComplete="off" or not, it would always provide an autocomplete... If I set it to autoComplete="no", it worked.

I'm using Downshift with Material UI, as per the official Material UI documentation, however I cannot for the life of me get autoComplete to change to a custom value. It always defaults back to 'autocomplete = off' when rendered.

It seems to be a Material UI issue, not Dropshift, as Dropshift sets autoComplete to 'nope' by default since version 2.0.12 - https://github.com/paypal/downshift/releases/tag/v2.0.12

Does anyone know how to fix this issue?

Nevermind, I checked the Dropshift source code and it hardcodes autoComplete to 'off'. I'll bring up the issue with them.

Why is the option called autoComplete instead of autocomplete? autocomplete is one word and not auto-complete

Ask React.

Is it the same issue like class and className in React?

This seems to have worked for me (we are using material ui with redux form)

      <Textfield
        inputProps={{
          autocomplete: "new-password",
        }}
      />

"new-password" works if the input is type="password
"off" works if its a regular text field wrapped in a form

@BenAhlander thanks, it worked for me when I used the inputProps. I think material-UI should properly document this.

Was this page helpful?
0 / 5 - 0 ratings