I'm using Vuetify's v-stepper component.
What I'm trying to achieve is:
- When a user clicks on a stepper step in the header, I want to block the click event if the active form is not valid.
I have been able to accomplish this by attaching the click listener to the span element:
<v-stepper-step :key="step.id" :step="step.id" :rules="[() => !!step.valid]" :editable="currentStepId !== step.id && currentStep.valid">
<span @click="headerClick" v-html="step.name"></span>
</v-stepper-step>
While this method works well and cancels the click event as intended, it only applies to the label and not the entire clickable area.
I would like the entire stepper-step button to trigger this behavior. However, attaching the click listener to the v-stepper-step itself is too late to cancel the click event using e.stopPropagation.
Is there a way for me to achieve this?
Here is a live demo for reference.
Thank you!