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

Multiple active steps not working #13147

Closed
2 tasks done
nikhilem opened this issue Oct 8, 2018 · 4 comments
Closed
2 tasks done

Multiple active steps not working #13147

nikhilem opened this issue Oct 8, 2018 · 4 comments
Labels
bug 🐛 Something doesn't work component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@nikhilem
Copy link
Contributor

nikhilem commented Oct 8, 2018

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

Expected Behavior

Multiple active Step components(enabled with active prop on Step component) inside Stepper should expand all Steps

Current Behavior

Multiple active Step components inside Stepper activates only one Step.

This works on Material-UI upto v3.1.1, but does not work in v3.1.2 onwards

Steps to Reproduce

Links:

  1. v3.1.1 demo(working) - https://codesandbox.io/s/rj5k2w6jo
  2. v3.1.2 demo(not working) - https://codesandbox.io/s/2vxjl116zy

Context

I'm trying to show all details inside stepper in one view, without expanding step manually

Your Environment

Tech Version
Material-UI v3.1.2
React 16.5.2
Browser Chrome 69
OS Linux(Ubuntu)
@eps1lon
Copy link
Member

eps1lon commented Oct 8, 2018

I think setting active on all Steps is a hacky way to achieve what #12948 is asking for. The change was caused by #13023.

The fix is pretty simple. Changing the order in https://github.com/spirosikmd/material-ui/blob/89f6c30fbf38e0ce87cd6bb5554bd460ef343e25/packages/material-ui/src/Stepper/Stepper.js#L88
should be sufficient. Do you want to work on it?

From a semantic point of view I don't see a reason to allow multiple active steps so I would say that you relied on a bug. The active prop on StepConnector should be controlled by the Stepper component. On the other hand the fix would give some control back to the user.

This would be no issue if we could get rid of the cloneElement pattern and let users control this via render props. See #12921 for more information.

@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. component: stepper This is the name of the generic UI component, not the React module! labels Oct 8, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 8, 2018

@eps1lon I have just spotted the issue too looking into #13130. We miss a unit test :)

-      React.cloneElement(step, { ...controlProps, ...step.props, ...state }),
+      React.cloneElement(step, { ...controlProps, ...state, ...step.props }),

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Oct 8, 2018
@nikhilem
Copy link
Contributor Author

nikhilem commented Oct 9, 2018

Thanks for looking into this @eps1lon. Shall I submit a PR with those changes? @oliviertassinari

@oliviertassinari
Copy link
Member

@nikhilem Yes, please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: stepper This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

3 participants