BUGFIX: Prevent committing values while going back and empty invalid resubmitted steps#72
Open
BUGFIX: Prevent committing values while going back and empty invalid resubmitted steps#72
Conversation
Previously, an already validated step was not validated again when resending. This happens now. Co-Authored-By: arsors <22658305+arsors@users.noreply.github.com>
… forms. The __target argument that was used for the navigation of multistep forms did make no distinction between back and forth navigating which. This change alters the behavior and prevents committing when __target is prefixed with an exclamation mark.
…ngValuesWhileGoingBackInMultiStepForms
…th invalid values Previously already committed steps were only replaced when a new valid state was pushed. This was unexpected as the user had changed the values and expects the new state to be submitted. With this change a step is overwritten when submitted again with valid data or removed otherwise.
98bfedb to
e4ee2dc
Compare
Member
Author
|
@MarcoPNS it would be great if you could test this with your use case. |
|
Hi! Thanks for your additional change. This seems to keep the MultiStepForm working as it did with my PR ✌️ |
Member
|
I can confirm that this fixes the bug, but it will reset the complete form step once you navigate back and forth: Steps to reproduce:
ExpectedValue for ActualAll form fields of step 2 are reset |
Member
Author
|
@bwaidelich thanks for testing, i can confirm your findings. Seems we need a way to persist also the invalid submitted values. This will take some time to do right. Regards Martin |
…kInMultiStepForms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Navigation back and forth in multi step forms had some issues:
Back navigations would commit the entered values when valid:
The __target argument that was used for the navigation of multistep forms did make no distinction between back and forth navigating. This change alters the behavior and prevents committing when __target is
prefixed with an exclamation mark.
If invalid data was committed for an already committed step no message is shown but the old data is used silently.
Previously committed steps were only replaced when a new valid state was submitted. This is unexpected as the user had changed the values and expects the new state to be submitted.
With this change a step is overwritten when submitted again with valid data- If invalid data is submitted the step data is removed and the used will see the validation messages.