form-wizard-vue3 icon indicating copy to clipboard operation
form-wizard-vue3 copied to clipboard

[HELP] Prevent tab change

Open emp-sean opened this issue 2 years ago • 2 comments
trafficstars

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.

emp-sean avatar Mar 09 '23 22:03 emp-sean

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

bels avatar Mar 16 '23 18:03 bels

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

julix14 avatar Mar 30 '23 12:03 julix14