redux-form的字段无法设置为自动完成

时间:2020-03-20 13:20:14

标签: reactjs material-ui redux-form

我想在redux表单的Field组件中关闭浏览器在输入字段上的自动完成功能,但是永远无法正常工作。我的代码如下。

import { Field, reduxForm } from 'redux-form/immutable';
import { TextField } from 'redux-form-material-ui';

<Field
  name="username"
  component={TextField}
  placeholder="Username"
  label="Username"
  InputProps={{ autoComplete: 'off' }} // this never works even though in the DOM's element, the attribute autocomplete="off" has already been exist
  required
  validate={[required]}
  className={classes.field}
/>

这是怎么回事?

1 个答案:

答案 0 :(得分:0)

实际的自动完成功能将应用于mediaSession.setPlaybackState( PlaybackStateCompat.Builder() .setActions( PlaybackStateCompat.ACTION_PLAY or PlaybackStateCompat.ACTION_PAUSE or PlaybackStateCompat.ACTION_REWIND or PlaybackStateCompat.ACTION_FAST_FORWARD or PlaybackStateCompat.ACTION_SEEK_TO ) .build() ) 参数指定的基本输入。提供component的{​​{1}}属性值将为您解决该问题。

autoComplete