Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<Step /> position is not respected #12

Open
capi1O opened this issue Apr 16, 2019 · 1 comment
Open

<Step /> position is not respected #12

capi1O opened this issue Apr 16, 2019 · 1 comment

Comments

@capi1O
Copy link

capi1O commented Apr 16, 2019

Describe the bug

Steps are layed out evenly, regardless of position prop value (position = width / number of steps).

To Reproduce
render steps by mapping over an array, ex :

const steps =
[
	{ id: 1,	percentage: 10,		src: 'image1.svg',	scale: 2 },
	{ id: 2,	percentage: 25,		src: 'image2.svg',	scale: 0.5 },
	{ id: 3,	percentage: 26,		src: 'image3.svg',	scale: 0.3 },
	{ id: 4,	percentage: 61,		src: 'image4.svg',	scale: 1 },
	{ id: 5,	percentage: 62,		src: 'image5.svg',	scale: 1 },
	{ id: 6,	percentage: 63,		src: 'image6.svg',	scale: 2 },
	{ id: 7,	percentage: 80,		src: 'image7.svg',	scale: 0.5 },
	{ id: 8,	percentage: 81,		src: 'image8.svg',	scale: 1 },
	{ id: 9,	percentage: 82,		src: 'image9.svg',	scale: 2 },
	{ id: 10,	percentage: 90,		src: 'image10.svg',	scale: 1 }
];
		<ProgressBar
								percent={percentage}
							>
								{steps.map(step => (
									<Step
										key={step.id}
										position={step.percentage}
										transition="scale"
									>
										{({ accomplished }) => (
											<img
												style={{ transform: `scale(${step.scale})` }}
												width="30"
												src={step.src}

											/>
										)}
									</Step>))
								}
							</ProgressBar>

Expected behavior

<Steps /> items are positioned along the progressbar according to number provided by position prop value.

  • OS: Ubuntu 18.04
  • Chrome
  • react-step-progress-bar 1.0.3

edit : providing stepsPositions on parent <ProgressBar /> does work

@capi1O capi1O changed the title position is not respected <Stap /> position is not respected Apr 16, 2019
@capi1O capi1O changed the title <Stap /> position is not respected <Step /> position is not respected Apr 16, 2019
@lako90
Copy link

lako90 commented May 20, 2020

Use stepPositions prop on ProgressBar component

https://pierreericgarcia.github.io/react-step-progress-bar/docs/progress-bar-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants