Skip to content

Commit 90d2346

Browse files
committed
fix: formsg continue button not expanding next step
1 parent 3a0a569 commit 90d2346

File tree

1 file changed

+10
-0
lines changed
  • packages/frontend/src/components/FlowSubstep

1 file changed

+10
-0
lines changed

packages/frontend/src/components/FlowSubstep/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ function FlowSubstep(props: FlowSubstepProps): JSX.Element {
135135

136136
const onToggle = expanded ? onCollapse : onExpand
137137

138+
// Skip to the next step if the substep is meant to be hidden
139+
useEffect(() => {
140+
if (!expanded) {
141+
return
142+
}
143+
if (!argsToDisplay || argsToDisplay.length === 0) {
144+
onSubmit()
145+
}
146+
}, [argsToDisplay, expanded, onSubmit])
147+
138148
if (!argsToDisplay || argsToDisplay.length === 0) {
139149
return <></>
140150
}

0 commit comments

Comments
 (0)