()
| 54 | // readers won't read the error message) so we need to do manual validation |
| 55 | // ourselves. |
| 56 | function handleEmailInputChange() { |
| 57 | const emailRegex = /[^@\s.][^@\s]*@\[?[a-z0-9.-]+\]?/i |
| 58 | const surveyEmail = getFormData()?.get('survey-email')?.toString() |
| 59 | |
| 60 | if (surveyEmail?.length === 0 || surveyEmail?.match(emailRegex)) { |
| 61 | setIsEmailError(false) |
| 62 | } else { |
| 63 | setIsEmailError(true) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | function submit(evt: React.FormEvent) { |
| 68 | evt.preventDefault() |
nothing calls this directly
no test coverage detected