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

[Stepper] Abstracting Step into a component break display #23645

Closed
2 tasks done
ghost opened this issue Nov 21, 2020 · 1 comment
Closed
2 tasks done

[Stepper] Abstracting Step into a component break display #23645

ghost opened this issue Nov 21, 2020 · 1 comment
Labels
component: stepper This is the name of the generic UI component, not the React module! discussion

Comments

@ghost
Copy link

ghost commented Nov 21, 2020

Hello everyone!

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

I created a component that contains Steps. While trying to add this component to the Stepper, I noticed that the Steps lose their states. Here is an example:

Current Behavior

Expected Behavior 🤔

Here is a screenshot of what I would like to get :

Expected Behavior

Steps to Reproduce 🕹

Link to the Sandbox.

Context 🔦

I'm want to conditionally add Steps to a Stepper.

Your Environment 🌎

Tech Version
Material-UI v5.0.0-alpha.16
React 17.0.1
Browser Firefox Browser Developer 83.0b10 (64 bits)
@ghost ghost added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 21, 2020
@oliviertassinari oliviertassinari added component: stepper This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 21, 2020
@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 21, 2020

The problem was solved in #21326, at least a large chunk of it.

If you are not allowing the cloneElement logic to kick-in, you need to provide the index and last props: https://codesandbox.io/s/adding-steps-that-are-in-another-component-to-a-stepper-does-not-work-forked-92lzi.

AFAIK, we can't do more about it without overengineering it. This issue will serve as documentation for the next developer facing the issue.

@oliviertassinari oliviertassinari added discussion and removed support: question Community support but can be turned into an improvement labels Nov 21, 2020
@oliviertassinari oliviertassinari changed the title Adding Steps that are in another component to a Stepper does not work. [Stepper] Abstracting Step into a component break display Nov 21, 2020
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! discussion
Projects
None yet
Development

No branches or pull requests

1 participant