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

Accessibility Improvements for PE Pattern #183

Merged
merged 2 commits into from
Aug 10, 2024

Conversation

scottjehl
Copy link
Contributor

@scottjehl scottjehl commented Aug 7, 2024

Hey! A couple of things that seemed they may help.

In the progressive enhancement pattern, the anchor's href is removed and it is meant to play the role of a play button from there. Without its href though, it lost its ability to gain keyboard focus or receive keyboard interaction (return or space), and it no longer conveyed any element meaning beyond a generic element.

Adding a role of button and tabindex gives it some buttony semantics and focusability. The event handlers give it buttony keyboard handling for space and enter.

And then the focusin addition is just to warm connections for keyboard users too.

In progressive enhancement pattern, the anchor's href is removed and it is meant to play the role of a play button from there. Without its href though, it lost its ability to gain keyboard focus or receive keyboard interaction (return or space), and it no longer conveyed any element meaning beyond a text node. 

Adding a role of button and tabindex gives it some buttony semantics, focusability. The event handlers give it buttony keyboard handling for space and enter. 

And then the focusin addition is just to warm connections for keyboard users too.
@scottjehl
Copy link
Contributor Author

Copy link
Owner

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you sir. 2 Qs on the keyboard bit..

src/lite-yt-embed.js Outdated Show resolved Hide resolved
src/lite-yt-embed.js Show resolved Hide resolved
I can not believe it's ' ' and not 'Space' who decides these things?? :)
@scottjehl
Copy link
Contributor Author

All in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants