I'm using a v-stepper from Vuetify.
What I want is:
- when the user click on a stepper step (in the header) I block the
click event
if the active form isn't valid
I've managed to do so but by setting the click
listener on 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>
This works well, the click is cancelled and that's exactly what I want. Here is a live demo you can interact with.
My issue is:
It only works on the label, not the full clickable area.
I would like the entire stepper-step button to call this method.
But if I attach the @click
listener on the v-stepper-step
then it's too late, I can't cancel the click event (by doing e.stopPropagation
).
Is there a way for me to do so? demo code
Thanks!