Trouble writing validator code for input

I am trying to have a form field validate email formatting.

My form is within an accordion, which is making it difficult to test this. This code seems to work outside of the editor, that regex is correct to the best of my knowledge.

Am I doing this incorrectly? Could it be the wrong selected value in the .test ?

https://studio.plasmic.app/projects/5wfiQsykEjzgVqMWi3s1vV

The component is leagueScheduleWidget and the validation is code is as follows

const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
return emailRegex.test($state.emailInput2[currentIndex].value);