Material-UI Autocomplete & TextField triggers google autocomplete

前端 未结 2 888
生来不讨喜
生来不讨喜 2020-12-10 07:07

I am trying to implement the Autocomplete component into my project but am getting the autofill/autocomplete from the browser after some time. Do you know how I can set it t

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 07:30

    Even with the latest:

     "@material-ui/core" 
     "@material-ui/lab"
    

    which contains the autoComplete property set to 'off', I wasn't able to get the autofill box go away.

    Also tried setting the attribute on the form tag

    ...

    To no avail.

    The thing which resolved the issue was setting the autoComplete field to 'new-password'

     input.onChange(val)}
        renderInput={(params) => {
            params.inputProps.autoComplete = 'new-password';
            return 
        }} 
    />
    

提交回复
热议问题