reactjs / react-autocomplete

WAI-ARIA compliant React autocomplete (combobox) component
MIT License
2.17k stars 532 forks source link

Unable to set `autoComplete` prop on input #354

Open daveaspinall opened 6 years ago

daveaspinall commented 6 years ago

I'd like to be able to define the value of the autoComplete prop added to the input to improve the autofill feature, and in some cases disable it.

Should adding the autoComplete prop overwrite the default autoComplete: 'off' value?

Chrome ignores the "off" value.

peterlcullen commented 6 years ago

You can use the renderInput prop to override this. Here's an example...

<Autocomplete
  // .... all the props you would normally use 
  items={items}
  renderItem={itemRenderer}

  // then add this, so you can override `autoComplete`
  renderInput={props => {
    return <input {...props} autoComplete="whatever-you-want" />;
  }}
/>
mousemke commented 5 years ago

chrome has changed and no longer respects the off that is the current default and should be set to new password as default (and hopefully accept props anyway if ppl want to change it. there is even a fix PR open. Any hope of these being merged.

(yes i realize there is a work around, but it is fixed.... just waiting to merge)