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(core)!: change the implementation of validationMode #6

Merged
merged 1 commit into from
Nov 18, 2022

Conversation

Mini-ghost
Copy link
Owner

@Mini-ghost Mini-ghost commented Nov 12, 2022

πŸ”— Linked issue

No issues linked to this PR

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently, Vorms's validationMode and reValidationMode support blur, change, submit and input. All modes except input rely on the corresponding native event, while the input mode relies on the implementation of setFieldValue().

The current implementation caused two problems:

  1. Unintuitive, you may not want to trigger validation when calling setFieldValue() manually.
  2. Integration with some UI frameworks is error-prone.

This PR will resolve that, it is going to support input mode with native events.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@Rock070
Copy link
Contributor

Rock070 commented Nov 12, 2022

Minimal Reproduction - stackblitz

Context: Using validateMode: input with Vuetify.

Click reset button, Vuetify built in reset handler run after Vorm reset, so the form would be validated because the Vuetify reset handler trigger the setFieldValue.

This PR solved the problem to me.

@Mini-ghost Mini-ghost merged commit 9fc4d67 into main Nov 18, 2022
@Mini-ghost Mini-ghost deleted the feat/update-validation-mode branch November 19, 2022 04:46
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.

None yet

2 participants