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

fix: updates support for aria-required attribute in to-be-required #590

Merged
merged 5 commits into from May 3, 2024

Conversation

JatinRanka
Copy link
Contributor

What:

The non-semantic HTML element fails toBeRequired method even though aria-required is set as true - #481

It does not implement this part of what's documented in MDN:

When form controls are created using non-semantic elements, such as a <div> with a role of checkbox, the aria-required attribute should be included, with a value of true, to indicate to assistive technologies that user input is required on the element for the form to be submittable. The aria-required attribute can be used with HTML form elements; it is not limited to elements that have an ARIA role assigned.

Why:

The current code only only adheres to aria-required attribute for a set of HTML elements

How:

Updated the toBeRequired method to not depend on tag type or role type for elements with aria-required attribute

Checklist:

  • Documentation
  • Tests
  • Updated Type Definitions
  • Ready to be merged

README.md Outdated Show resolved Hide resolved
@JatinRanka JatinRanka requested a review from gnapse May 1, 2024 06:59
@gnapse gnapse merged commit 20aca33 into testing-library:main May 3, 2024
5 checks passed
Copy link

github-actions bot commented May 3, 2024

🎉 This PR is included in version 6.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JatinRanka JatinRanka deleted the fix/to-be-required branch May 6, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants