I have a v-combobox which allows the user to select from a list of email addresses or add new ones that arent in the list. The issue is the rule does not apply to all items in the list. So if there is a new item added that the email is not valid but there is a valid entry already then it fails. I need the validation rules to check every item in the array. This is what I had tried:
<v-combobox
color="primary"
label="To"
:items="stateData && stateModel ? stateData.find(item => item.state_id == stateModel?.state_id)?.state_contacts : []"
item-title="email_address"
v-model="toModel"
:rules="emailRule"
chips
multiple
variant="outlined"/>
and the rule is as follows:
const emailArrayRule = [ (e: any, value: string) => /.+@.+/.test(value) || 'Invalid Email address' ]