patternfly / patternfly-react

A set of React components for the PatternFly project.
https://react-staging.patternfly.org/
MIT License
775 stars 352 forks source link

Bug - Wizard - Odd behavior when updating steps #9752

Closed gitdallas closed 2 months ago

gitdallas commented 11 months ago

Describe the problem If you have a wizard load with no steps and then the steps get populated, the wizard will not show them. If you have the wizard loaded with steps and then the steps change, there is some other odd behavior (steps getting truncated or left behind).

New Wizard with ability to change steps: https://codesandbox.io/s/competent-fire-dd3vgr?file=/index.tsx

Old Wizard works fine with similar code: https://codesandbox.io/s/trusting-tess-9hxrt8?file=/index.tsx

workaround can be something that prevents it from rendering until after the data is updated, simulated here by "empty" in between step changes, https://codesandbox.io/s/charming-feather-7zyvxm?file=/index.tsx

jpuzz0 commented 11 months ago

Another workaround would be to pass a "key" to the Wizard to force a re-render on state change; e.g. <Wizard key={steps.length}>

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

dlabrecq commented 3 months ago

Cost Management encountered the same issue trying to upgrade the wizard to v5. We start out with a single step, the user makes a selection, then we create a new set of steps.

Ideally, we want to upgrade all PF components prior to v6. This is our last deprecation to remove.