MCPcopy Create free account
hub / github.com/github/docs / handleEmailInputChange

Function handleEmailInputChange

components/page-footer/Survey.tsx:56–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 1

getFormDataFunction · 0.85

Tested by

no test coverage detected