autoComplete "on" not working in ReactJs form

Viewed 2324

I have below form in react for which i need to implement "autoComplete="on" so that next time if users want to input same value, it should be suggested as auto complete.Below is my code

<form className={classes.container} noValidate>
  <Grid container item xs={12} alignItems="center">
    <TextField
      id="outlined-bare"
      className={classes.textField1}
      defaultValue=""
      margin="normal"
      variant="outlined"
      autoComplete="on"
      InputProps={{ style: { height: 40 } }}
      onChange={(e) => handleChange(e, 'Name')}
    />
  </Grid>

The component is being rendered is Chrome browser. What's wrong or missing here?

1 Answers

Here is the code below. You can add autoComplete="on" in form tag.

<form className={classes.container} noValidate  autoComplete="on">
  <Grid container item xs={12} alignItems="center">
    <TextField
      id="outlined-bare"
      className={classes.textField1}
      defaultValue=""
      margin="normal"
      variant="outlined"
      autoComplete="on"
      InputProps={{ style: { height: 40 } }}
      onChange={(e) => handleChange(e, 'Name')}
    />
  </Grid>
</form>
Related