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

do not re-validate on blur if already validated #77

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

joelhawksley
Copy link
Contributor

In testing #76 in GitHub.com, we discovered cases where input would be re-validated on blur even if the input had not changed. This PR updates our valid and invalid code paths to only validate on blur if the input has not otherwise been already validated.

(for Hubbers) See internal issue: https://github.com/github/new-user-experience/issues/242, task #1.

In testing #76 in
GitHub.com, we discovered cases where input would be re-validated
on blur even if the input had not changed. This PR updates our
valid and invalid code paths to only validate on blur if the input
has not otherwise been already validated.
@Copilot Copilot bot review requested due to automatic review settings December 11, 2024 19:21
@joelhawksley joelhawksley requested a review from a team as a code owner December 11, 2024 19:21

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (2)

test/auto-check.js:63

  • The test case 'does not emit on blur if input has not changed after initial blur' should also verify that the 'dirty' attribute is removed after validation to ensure the attribute is correctly managed.
it('does not emit on blur if input has not changed after initial blur', async function () {

src/auto-check-element.ts:228

  • The condition should check for the absence of the 'dirty' attribute to avoid re-validating on blur if the input has not changed. Replace autoCheckElement.hasAttribute('dirty') with !autoCheckElement.hasAttribute('dirty').
autoCheckElement.hasAttribute('dirty')) ||

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@joelhawksley joelhawksley merged commit 718eff9 into main Dec 11, 2024
4 checks passed
@joelhawksley joelhawksley deleted the dont-validate-on-blur-if-unchanged branch December 11, 2024 19:24
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.

2 participants