I have an email input in my response component:
<input
type="email"
autoComplete="email"
placeholder="Email"
required
value={this.state.formData.email}
onChange={this.handleFieldChange('email')}
/>
which gives me a warning in the console:
The specified value "myemail" is not a valid email address.
with each keystroke until you enter the correct email address. I believe this is the default HTML5 email verification message, and since I change my state with every keystroke, I react to the changes, and HTML5 checks it again. Changing the type to “text” corrects it, but I would like to save it as “email”. What would be the right way to handle this in the reaction to avoid these html5 warnings?
source
share