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: when next step is deleted, props.value doesn't update #4034

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

RODO94
Copy link
Contributor

@RODO94 RODO94 commented Dec 3, 2024

Found that when you deleted a step from the NextSteps component, it wouldn't set description or url to "", but not set it at all. This meant previous values with the same index would persist until it is submitted then when it is reloaded, data would return to the formik saved values.

Looked into trying to alter the data model, but got a bit caught up in the components and functions with the way they are passed down and back up. Open to suggestions on a more robust change, but this seemed to work.

Copy link

github-actions bot commented Dec 3, 2024

Removed vultr server and associated DNS entries

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this one up! Pizza working as expected for me, would be good to get this one merged & live to un-block content team if you and August are also happy with it 👍

In future, this bug/expected behavior also feels like a good candidate to write a unit test for (eg NextSteps/Editor.test.tsit("preserves existing steps values when one is deleted"))

@RODO94 RODO94 marked this pull request as ready for review December 3, 2024 16:32
@RODO94 RODO94 merged commit fa6d9d0 into main Dec 3, 2024
12 checks passed
@RODO94 RODO94 deleted the rory/next-steps-bug-fix branch December 3, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants