You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
It's possible to block a step on condition, it's a bit tricky but it works. You'll find below how I figured it out.
let steps = bulmaSteps.attach('.steps', {
...
beforeNext: id => {
switch(id) {
// first step
case 0:
// must return an array of errors
// if empty it goes to next step
// if not empty it triggers onError with the first item of array
return validateFirstStep();
// second step
case 1:
...
}
},
onError: error => {
console.log(error);
}
});
const validateFirstStep = () => {
let errors = [];
...
if (validationRuleNotVerified) {
errors.push('Validation rule not verified');
}
if (otherValidationRuleNotVerified) {
errors.push('Other validation rule not verified');
}
return errors;
};
Is it possible block nextStep? I have tried with "return false;" in beforeNext event but not work.
Thanks!
The text was updated successfully, but these errors were encountered: