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

1-off error in MobileStepper #12388

Closed
2 tasks done
ScottieR opened this issue Aug 2, 2018 · 1 comment
Closed
2 tasks done

1-off error in MobileStepper #12388

ScottieR opened this issue Aug 2, 2018 · 1 comment
Assignees
Labels
component: stepper This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@ScottieR
Copy link

ScottieR commented Aug 2, 2018

  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Mobile stepper should show correct percentage of steps in progress bar

Current Behavior

Right now it's calculating the percentage complete based on (active step)/(total steps - 1) * 100. This gives weird results where the progress is 0 on first step, 33% on second, 66% on third and 100% on fourth. It should either show 0 on step 1 and 75% on last step, or (and probably preferred) 25% on first step and 100% on last step. So: (active step + 1) / (total steps) * 100

Steps to Reproduce

Look at the existing demo on the demos page, which has 6 steps. Actually count and at step 3 of 6 the stepper is not 50%.

Link: https://material-ui.com/demos/steppers/

Context

We show "Step [x]/[total]" on our mobile stepper and it looks very weird when it's step 2/4 and not 50%

Your Environment

Tech Version
Material-UI v1.4.2
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 2, 2018

@ScottieR The MobileStepper accounts for the number of steps completed. It's opinionated. The specification seems to encourage (I have done the math with the number of pixels) the number of steps in progress: https://material.io/archive/guidelines/components/steppers.html#steppers-types-of-steps like you are suggesting. I fear changing the logic is a breaking change.

Maybe adding a LinearProgressProps property to change override the value would do it? Do you want to work on it?

@oliviertassinari oliviertassinari added new feature New feature or request component: stepper This is the name of the generic UI component, not the React module! labels Aug 2, 2018
@oliviertassinari oliviertassinari self-assigned this Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: stepper This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants