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 form validation docs example #2049

Merged

Conversation

ConorCorp
Copy link
Contributor

@ConorCorp ConorCorp commented Nov 27, 2023

Description

The form example provided in the docs had 2 issues.

  1. The custom validation message would not show on first submit because reportValidity wasn't called. Forcing the user to press a submit button 2x before seeing the message.
  2. You couldn't submit the form after fixing the input because setCustomValidity was locked to the first error message. It needed to be cleared on keyup.

Corresponding issue:

Testing

Tested on chrome and brave with a form / submit button on the form.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • [] I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added the documentation Improvements or additions to documentation label Nov 29, 2023
Copy link
Collaborator

@alexpetros alexpetros left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@alexpetros alexpetros merged commit 255cb9b into bigskysoftware:master Dec 1, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants