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

Add manual validation trigger #79

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Add manual validation trigger #79

merged 3 commits into from
Jan 13, 2025

Conversation

sutterj
Copy link
Contributor

@sutterj sutterj commented Jan 10, 2025

This adds a method to the web component to manually trigger the auto-check element to validate the input. This is useful for validating pre-populated fields on a form as the auto-check element does not currently validate fields if they have not been changed since load. Using this method, we can force the auto-check element to validate the input as needed.

(For Hubbers) see internal issue: github/new-user-experience#292

@Copilot Copilot bot review requested due to automatic review settings January 10, 2025 20:46
@sutterj sutterj requested a review from a team as a code owner January 10, 2025 20:46
@sutterj sutterj requested a review from joelhawksley January 10, 2025 20:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • custom-elements.json: Language not supported
Comments suppressed due to low confidence (1)

src/auto-check-element.ts:112

  • [nitpick] The event name 'triggerValidation' should follow a consistent naming convention.
input.addEventListener('triggerValidation', changeHandler)

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

README.md Outdated Show resolved Hide resolved
src/auto-check-element.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@joelhawksley joelhawksley left a comment

Choose a reason for hiding this comment

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

Excellent! 👏🏻

Copy link

@andimiya andimiya left a comment

Choose a reason for hiding this comment

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

Nice!

@camertron camertron merged commit c5f9802 into main Jan 13, 2025
4 checks passed
@camertron camertron deleted the manual-validation-trigger branch January 13, 2025 18:53
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.

4 participants