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

fix(steps): make active step controlled via props #7300

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

ddoemonn
Copy link
Contributor

@ddoemonn ddoemonn commented Oct 2, 2024

fixes #7298
Fix #7303

before

Screen.Recording.2024-10-02.at.22.07.11.mov

after

Screen.Recording.2024-10-02.at.22.07.32.mov

We shouldn't use useState for dynamic change here we need to use props.activeIndex directly.

Also, I checked It doesn't broke other step examples.

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Oct 2, 2024 7:11pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Oct 2, 2024 7:11pm

@melloware
Copy link
Member

Did you test it in Controlled AND uncontrolled mode. Typically PR stored that in a useState and has checks that check if props.onStep or somethig is ing Contolled vs Uncontrolled mode.

@ddoemonn
Copy link
Contributor Author

ddoemonn commented Oct 2, 2024

Yes @melloware I checked! Like I said because of using state here activeIndex doesn't work because in React when you sent props to a state it will use only in first render.

Screen.Recording.2024-10-02.at.22.51.02.mov

@melloware melloware merged commit 67390ea into primefaces:master Oct 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants