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

Highlight non-breaking whitespace in getByRole failure message #1314

Open
ckundo opened this issue Jun 3, 2024 · 0 comments
Open

Highlight non-breaking whitespace in getByRole failure message #1314

ckundo opened this issue Jun 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ckundo
Copy link

ckundo commented Jun 3, 2024

When using getByRole, represent non-breaking whitespace in failure output as  , so that it's easier to diagnose the distinguish between " " and  . This would be in the list below "here are the accessible roles" under the "name" output.

Motivation: Non-breaking whitespace is not collapsed into " " in the accname calculation. This is correct according to the ARIA spec, but is tricky to debug getByRole failures related to usage of non-breaking whitespace. See also #904

Alternatives considered

We considered a custom helper to automatically collapse whitespace, but that is harder to maintain and discover than having the behavior in the core library. Further, it does not actually represent end-user experience since the browser does not perform this collapsing automatically.

@eps1lon eps1lon added the enhancement New feature or request label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants