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(core): remove mount validation on touch #726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Balastrong
Copy link
Member

@Balastrong Balastrong commented May 30, 2024

This PR closes #689

A few considerations:

  1. When should we remove the errors?
    My proposal would be to remove each field individually when gets touched and the form as soon as a field is touched.
    As long as a field is not touched, it keeps the mount errors.

  2. Should we be able to submit a form with onMount errors?
    I'd say no, but currently if state.submissionAttempts === 0 && !isTouched we have canSubmit: true
    Adding && !hasOnMountError also aims to fix the unwanted behavior described in canSubmit is always true on first render of form #723

  3. We might want to explicitly explain in the docs how we intend onMount to behave
    I'm happy to improve the docs in this PR if we decide to go through with the proposed behavior

  4. Bonus
    The amount of eslint disable on form.errorsMap makes me wonder if we should consider it as optional in first place, but that's maybe another topic.

Copy link

nx-cloud bot commented May 30, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit facf85e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

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.

onMount Error is not revalidated when the user changes the input
1 participant