Skip to content

Commit

Permalink
fix: πŸ› modified selectValues logic for required fields only
Browse files Browse the repository at this point in the history
 modified selectValues logic for required fields only      βœ… Closes: #554
  • Loading branch information
BabarKhanSQ authored Jan 18, 2022
1 parent 94668df commit af8fe9b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/SQFormDialogStepper/SQFormDialogStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,14 @@ export function SQFormDialogStepper({
return false;
}
const currentStepKeys = Object.keys(validationSchema.fields);
const stepValues = currentStepKeys.every((step) => {
return !!values[step];
const stepValues = currentStepKeys.every((step) => {
if (
values[step].length === 0 &&
validationSchema.fields[step]?.tests[0]?.OPTIONS?.name === 'required'
) {
return false;
}
return true;
});

if (
Expand Down

0 comments on commit af8fe9b

Please sign in to comment.