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

Align behavior with Primer guidance behind only-validate-on-blur toggle #76

Merged
merged 9 commits into from
Nov 26, 2024

Conversation

joelhawksley
Copy link
Contributor

@joelhawksley joelhawksley commented Nov 22, 2024

Problem

Us folks working on improving the GitHub.com signup flow are looking to address a UX/a11y concern with the auto-check element: it validates on every keystroke.

  • This UX is frustrating to users who may not have provided a complete input yet, such as a partial email address in our case.
  • This UX is frustrating to screen reader users who are spammed with announcements on every keystroke.

Proposed solution

We should modify the behavior to align with https://primer.style/ui-patterns/forms/overview#inline-validation, which states:

Don't attempt to validate an input before the user is done with it. Validation may be performed as the user is typing or making their selection, but only after the first time the input has been validated and the input is in an invalid state. This gives the user early positive feedback by removing the error if the user makes a change that fixes it.

I've done so behind an opt-in only-validate-on-blur (anyone got a better name?) toggle. My hope is to ship this change and then test it across our use-cases on GitHub.com. If it proves to be viable in all cases, I'll make the case to change the default value to true in a breaking release ❤️

I've validated this proposal with both Primer and a11y folks.

Notes for reviewers

Most of my notes are left as code comments: I found this tricky to test at times but was able to figure out coverage for most of it. I did exercise it locally as much as possible.

I did run into a little bit of friction when setting up my local development environment, so I've included a few small docs updates as well.

Closes: #75

@joelhawksley joelhawksley changed the title Align behavior with Primer guidance behind validate-after-first-blur toggle Align behavior with Primer guidance behind only-validate-on-blur toggle Nov 25, 2024
@joelhawksley joelhawksley marked this pull request as ready for review November 25, 2024 23:05
@joelhawksley joelhawksley requested a review from a team as a code owner November 25, 2024 23:05
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Seems fully baked 👍🏻 Thanks for the tests

@joelhawksley joelhawksley merged commit 32051d9 into main Nov 26, 2024
4 checks passed
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.

Align behavior with Primer guidance behind validate-after-first-blur toggle
2 participants