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

Use aria-required instead of required on required form elements #4023

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Dec 5, 2023

Added later by @siddharthkp: Hi 👋 This change was to workaround native browser validation errors. aria-required communicates the same message and was approved by the a11y team 👍.

Closes #

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

Merge checklist

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 1600730

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 5, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.82 KB (+0.02% 🔺)
dist/browser.umd.js 105.35 KB (+0.01% 🔺)

@mperrotti
Copy link
Contributor Author

This was opened as a draft PR to address a problem with inputs using HTML5 browser-native validation because of the required attribute being passed to the <input />.

Here are two possible alternatives to these changes:

  • use the invalid event on the input, and call event.preventDefault() in the event handler
  • set the novalidate attribute on the parent form

@mperrotti mperrotti marked this pull request as ready for review December 7, 2023 21:53
@mperrotti mperrotti requested review from a team and broccolinisoup December 7, 2023 21:53
@mperrotti mperrotti added this pull request to the merge queue Dec 8, 2023
Merged via the queue into main with commit 83c125f Dec 8, 2023
29 checks passed
@mperrotti mperrotti deleted the mp/pref-aria-required branch December 8, 2023 17:31
@primer primer bot mentioned this pull request Dec 8, 2023
TylerJDev pushed a commit that referenced this pull request Dec 11, 2023
…4023)

* sets aria-required attr instead of required

* Create khaki-rules-breathe.md
@primer primer bot mentioned this pull request Dec 19, 2023
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.

3 participants