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

Add tabindex="0" by default #49

Open
zachleat opened this issue May 23, 2021 · 2 comments
Open

Add tabindex="0" by default #49

zachleat opened this issue May 23, 2021 · 2 comments
Labels
enhancement New feature or request needs discussion

Comments

@zachleat
Copy link
Member

via #48 and more specifically this comment by @chrisbrownie55 #22 (comment)

@zachleat
Copy link
Member Author

Hmm, if the region is not scrollable—is tabindex desirable? Not sure if this should be a default change…

@andria-dev
Copy link
Contributor

@zachleat I think it'd be more desirable than making all code blocks with scrollbars inaccessible to keyboard users and others that need to scroll without a pointer device. A possible alternative would be to use a ResizeObserver on code blocks and determine if a scrollbar is present by checking if element.scrollHeight > element.clientHeight and then apply tabindex="0" or remove it.

I think the most accessible solution would probably be a progressive enhancement where we start with tabindex="0" by default and then include a script that'll do the above ResizeObserver technique to remove or add tabindex="0" when a code block changes shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs discussion
Projects
None yet
Development

No branches or pull requests

2 participants