Skip to content

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 AI 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 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

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.

5 participants