Skip to content

Commit 7fcc1b1

Browse files
authored
Fix progress line not connecting if there's only one (#2449)
1 parent 8fa1582 commit 7fcc1b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/multi-step-form.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ export function MultiStepForm ({ children, initial, steps }) {
5353

5454
function Progress () {
5555
const steps = useSteps()
56+
const maxSteps = useMaxSteps()
5657
const stepIndex = useStepIndex()
5758

5859
const style = (index) => {
5960
switch (index) {
60-
case 0: return { marginLeft: '-5px', marginRight: '-13px' }
61+
case 0: return maxSteps === 2 ? { marginLeft: '-13px', marginRight: '-15px' } : { marginLeft: '-5px', marginRight: '-13px' }
6162
case 1: return { marginLeft: '-13px', marginRight: '-15px' }
6263
default: return {}
6364
}

0 commit comments

Comments
 (0)