fix: progress bar calculation (#5339)

This commit is contained in:
Dhruwang Jariwala
2025-04-15 06:21:47 +05:30
committed by GitHub
parent 7b764c8427
commit 93d91f80f2

View File

@@ -83,7 +83,7 @@ export const calculateElementIdx = (
return survey.questions.findIndex((e) => e.id === lastQuestion?.id);
};
let elementIdx = currentQustionIdx || 0.5;
let elementIdx = currentQustionIdx + 1;
const lastprevQuestionIdx = getLastQuestionIndex();
if (lastprevQuestionIdx > 0) elementIdx = Math.min(middleIdx, lastprevQuestionIdx - 1);