Align behavior with Primer guidance behind only-validate-on-blur toggle #76
+148
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.Proposed solution
We should modify the behavior to align with https://primer.style/ui-patterns/forms/overview#inline-validation, which states:
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