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

isFocusable is too strict on tabindex #4632

Open
WilcoFiers opened this issue Nov 6, 2024 · 2 comments
Open

isFocusable is too strict on tabindex #4632

WilcoFiers opened this issue Nov 6, 2024 · 2 comments
Labels
core Issues in the core code (lib/core) fix Bug fixes good first issue For first-time contributors

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Nov 6, 2024

The way axe-core checks whether tabindex is valid is by calling parseInt(). That's different from how HTMLhttps://html.spec.whatwg.org/#rules-for-parsing-integers says to do it. Basically, axe should use this to match, and then parseInt the captured group: /^\s*([-+]?\d+)/

The issue is here: lib/commons/dom/is-focusable.js
The tests for it need to be here: test/commons/dom/is-focusable.js

@WilcoFiers WilcoFiers added core Issues in the core code (lib/core) fix Bug fixes good first issue For first-time contributors labels Nov 6, 2024
@ahmedhalac
Copy link

Hi @WilcoFiers. Can I work on this?

@WilcoFiers
Copy link
Contributor Author

@ahmedhalac, yeah that would be great!

ahmedhalac added a commit to ahmedhalac/axe-core that referenced this issue Nov 11, 2024
Ensures tabindex is correctly parsed as an integer using regex instead of parseInt to comply with HTML standards.

Related to dequelabs#4632
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) fix Bug fixes good first issue For first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants