bahadirsofuoglu / form-wizard-vue3

A form wizard/stepper component made with Vue
https://bahadirsofuoglu.github.io/form-wizard-vue3/
MIT License
30 stars 6 forks source link

[HELP] Prevent tab change #32

Open emp-sean opened 1 year ago

emp-sean commented 1 year ago

Hi there, is there a way to prevent the tab change if there are conditions not met.

I.e. I'm trying to use the onTabBeforeChange event to check parameters and prevent the change, but nothing I try appears to work.

const onTabBeforeChange = (index, oldIndex) => {
    switch (currentTabIndex)
    {
        case 0:
            if (selectedUtility.value == undefined && selectedBuilding.value == undefined)
                //Prevent the change

            break;
    }
};

Thanks.

bels commented 1 year ago

I am also looking for this kind of functionality. Let me know if you find anything out.

julix14 commented 1 year ago

I don't know an exact solution for your approach. In my project i faced a similar problem and i wanted that the user can only continue the wizard if a condition was met. So, i enable and disable the continue button dynamically. How this could work is mentioned in this issue https://github.com/bahadirsofuoglu/form-wizard-vue3/issues/31