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

Fix keyboard (Space or Enter) operation of buttons. Fixes #2888. #2889

Closed

Conversation

OwenEdwards
Copy link
Member

When video.js moved to using button elements instead of DIVs for buttons in V5, it kept the keyboard handling to simulate a click on Space or Enter key press, even though the browser does this for buttons. This causes an issue with Firefox when performing keyboard operation of buttons like the Play/Pause button.

@gkatsev gkatsev added the a11y This item might affect the accessibility of the player label Jan 11, 2016
attributes = assign({
role: 'button',
Copy link
Member

Choose a reason for hiding this comment

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

is it bad to just have both assigned? Or just to make the final markup simpler?

Copy link
Member Author

Choose a reason for hiding this comment

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

If by 'both' you mean the element tag and the role, then see https://www.w3.org/TR/html5/dom.html#aria-usage-note:

NOTE: In the majority of cases setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and not recommended as these properties are already set by the browser.

There has been further discussion about this within W3C, but that's the current recommendation.

The type attribute needs to be set on a <button> element, as noted in the comment.

@gkatsev
Copy link
Member

gkatsev commented Jan 12, 2016

Have a question about role/type attributes.
LGTM.

@gkatsev gkatsev added patch This PR can be added to a patch release. confirmed labels Jan 12, 2016
@gkatsev
Copy link
Member

gkatsev commented Jan 18, 2016

Going to close this because it's getting merged as part of #2897.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y This item might affect the accessibility of the player confirmed patch This PR can be added to a patch release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants