-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
input type="search" isn't considered of role "searchbox" #511
Comments
Also seeing this issue in |
I wonder if this has arisen due to:
REF: https://www.w3.org/TR/html-aam-1.0/#html-element-role-mappings Which has potentially been interpreted in https://github.com/A11yance/aria-query/pull/447/files#diff-474a847bde3a1c2a805f8616f2f2acd267500c5298c16c597743c26323994b5a to mean that the role of Comparing with the W3C Recommendation for HTML-ARIA it seems this is not a stable part of specs as yet. R.E. the (V. possible I am interpreting how this repo works and way off 😅) |
Avoid `aria-query` `v5`, transiently pulled in via `@testing-library/react`, due to A11yance/aria-query#511
Test cases (using resolutions to force import "react";
import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
describe("W3C Recommendations: https://www.w3.org/TR/html-aria/#docconformance", () => {
test("input with type search and no list attribute is a searchbox", async () => {
render(<input type="search" />);
expect(await screen.queryByRole("searchbox")).not.toBeNull(); // Fail ❌
});
test("input with type search and a list attribute is a combobox", async () => {
render(<input type="search" list="foo" />);
expect(await screen.queryByRole("combobox")).not.toBeNull(); // Fail ❌
});
});
describe("W3C Working Draft: https://www.w3.org/TR/html-aam-1.0/#html-element-role-mappings", () => {
test("input with type search and matching list and aria-controls attributes is a combobox under the W3C Draft Spec", async () => {
render(<input type="search" aria-controls="foo" list="foo" />);
expect(await screen.queryByRole("combobox")).not.toBeNull(); // Passes ✅
});
}); See testing-library/dom-testing-library#1235 (comment) for notes on how this regressed (and other cases). |
This part of the spec is super confusing. And it varies from versions 1.1 to 1.2 to the upcoming 1.3. I wasn't aware of this testing library using |
As a starter for 10 I've raised #515 which I believe addresses the issues - depending on whether go with 1.2 vs 1.3 on this particular issue, it may need some tweaks 🙂 |
I think we should go with 1.3 going forward, but given the breakages that my recent release caused, I'm going to shift the changes into a v6 branch of this project, and keep v5 on #515 fixes that you proposed. |
@jlp-craigmorten #515 is committed and released in v5.3.0. |
Previously considered the following code as of role "searchbox" but it is now considered as "textbox"
Now I have to add a
list
attribute to have the input with the implicit role of "searchbox".Shouldn't this be considered a breaking change? I have an entire project that relies on the previous behavior.
As from MDN Technical summary
This behavior is happening since v5.2.0
The text was updated successfully, but these errors were encountered: