I am not the only one, but here is the solution, EA
This is the offending function being called in EmailForm.js
function validateEmailAddress(email) {
let validationExp = /^[\S]+@[\w]+(\.[\w]+)*\.\w{2,}$/;
if(!email.match(validationExp)){
return false;
}
return true;
}
This is wrong, obsolete and should not be there. The code in EmailForm.js is using double email checking. The first check is right and points to index.js in the email-validator/index.js package, the second is the above, bad code
React.useEffect(() => {
const keyDownHandler = event => {
if (emailValidator.validate(emailAddress) && validateEmailAddress(emailAddress) && event.key === 'Enter') {
event.preventDefault();
submitEmailAddress();
}
};
emailValidator.validate() does the trick. Just get rid of the redundant, flawed email check and you're done.