Currently, I am in the process of setting up a form using Quasar and implementing internal validation. The specific issue I am facing involves a group of checkboxes where the user must select at least one option. While I have successfully implemented the validation on form submit, there is one aspect that is causing me frustration: when the validation fails (meaning the user did not select any checkbox), there is no focus on that particular field, unlike with other fields utilizing internal validation. I suspect this might be due to my use of a q-field instead of a q-input.
Below is a snippet of my code for reference:
<q-field v-model="selectedFruits"
class="q-gutter-sm"
:rules="[ val => val.length >= 1 || 'Select at least one fruit']"
:disable="isReadOnly()">
<q-checkbox v-model="selectedFruits" val="Apple" label="Apple"/>
<q-checkbox v-model="selectedFruits" val="Banana" label="Banana"/>
<q-checkbox v-model="selectedFruits" val="Pear" label="Pear"/>
<q-checkbox v-model="selectedFruits" val="Peach" label="Peach"/>
</q-field>
If anyone has any insights or suggestions to resolve this issue, please feel free to share.