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

[a11y]: TableToolbarSearch: use <input type=search> #18031

Open
2 tasks done
wkeese opened this issue Nov 11, 2024 · 1 comment
Open
2 tasks done

[a11y]: TableToolbarSearch: use <input type=search> #18031

wkeese opened this issue Nov 11, 2024 · 1 comment

Comments

@wkeese
Copy link
Contributor

wkeese commented Nov 11, 2024

Package

@carbon/react

Browser

Chrome

Operating System

MacOS

Package version

1.70

React version

18

Automated testing tool and ruleset

none

Assistive technology

No response

Description

Description

The first rule of ARIA use is:

If you can use a native HTML element [HTML51] or attribute with the semantics and behaviour you require already built in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so.

TableToolbarSearch currently renders:

<input ... class="cds--search-input" role="searchbox" ... type="text" tabindex="0" value="">

As written in https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/searchbox_role, it should be:

<input type="search" />

WCAG 2.1 Violation

No response

Reproduction/example

https://react.carbondesignsystem.com/?path=/story/components-datatable-toolbar--default

Steps to reproduce

N/A

Suggested Severity

None

Code of Conduct

@tay1orjones
Copy link
Member

Thanks for opening this @wkeese, I agree we should look at this again. There may have been a historical reason as to why searchbox was chosen over type="search", but we should research and update it if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

5 participants