Fix onClick handlers passing event object to handleNextStep

The issue was that onClick={onNextStep} passes the click event as the first argument,
making targetIndex an object instead of undefined. This caused handleNextStep to fall
through to linear progression instead of properly checking branching logic.

Fixed by wrapping with arrow function: onClick={() => onNextStep()}
This commit is contained in:
2026-03-21 20:35:54 -04:00
parent 3491bf4463
commit 3fafd61553
2 changed files with 2 additions and 2 deletions

View File

@@ -188,7 +188,7 @@ export function TrialControlPanel({
Pause
</Button>
<Button
onClick={onNextStep}
onClick={() => onNextStep()}
disabled={currentStepIndex >= steps.length - 1}
size="sm"
>

View File

@@ -404,7 +404,7 @@ export function WizardExecutionPanel({
onClick={
currentStepIndex === steps.length - 1
? onCompleteTrial
: onNextStep
: () => onNextStep()
}
className={`w-full max-w-sm text-white shadow-lg transition-all hover:scale-[1.02] ${
currentStepIndex === steps.length - 1