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

feat: add option to switch to full verification #54

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

ilyaliao
Copy link
Contributor

@ilyaliao ilyaliao commented Nov 3, 2024

This PR fixes #53 where form validation stops prematurely due to short-circuit evaluation in the verify() method. Previously, when a field validation failed, subsequent fields would not be validated due to the && operator's short-circuit behavior.

This PR will add an option to switch to full verification.

Copy link
Owner

@LittleSound LittleSound left a comment

Choose a reason for hiding this comment

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

These are two different strategies: full validation and stopping after encountering an error. We can provide an option during validation to choose the method to use. This avoids destructive updates and is more flexible.

@LittleSound
Copy link
Owner

By the way, I'm very happy to see someone using SlimeForm and submitting a PR for it! ☺️

@ilyaliao
Copy link
Contributor Author

ilyaliao commented Nov 3, 2024

These are two strategies: full validation and stopping after encountering an error. We can provide an option during validation to choose the method to use. This avoids destructive updates and is more flexible.

Thanks for the feedback! You're right, having an option to choose validation strategies would be more flexible. I'll work on implementing this approach.

@ilyaliao ilyaliao changed the title fix(verify): short-circuit causing incomplete field verification feat: Add option to switch to full verification Nov 3, 2024
@LittleSound LittleSound changed the title feat: Add option to switch to full verification feat: add option to switch to full verification Nov 5, 2024
@LittleSound LittleSound merged commit 0e876fa into LittleSound:main Nov 5, 2024
1 check failed
@LittleSound
Copy link
Owner

Thank you very much!

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.

feat: Add option to switch to full verification
2 participants