-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Disable interaction with disabled clickable components #3525
Disable interaction with disabled clickable components #3525
Conversation
There are two more listeners being set up in the constructor. Should we move all the listeners being added to |
Makes sense. I've also updated to make the component not selectable from the keyboard. |
@OwenEdwards can you take a look at this? LGTM, otherwise. |
@@ -158,6 +164,13 @@ class ClickableComponent extends Component { | |||
disable() { | |||
this.addClass('vjs-disabled'); | |||
this.el_.setAttribute('aria-disabled', 'true'); | |||
if (typeof this.tabIndex_ !== 'undefined') { | |||
this.el_.removeAttribute('tabindex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had to enforce consistent use of tabIndex
rather than tabindex
throughout the code - it doesn't make any difference here, but it would be better for consistency.
Otherwise LGTM
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Works great.
@mister-ben would you be able to rebase this against master? Otherwise, I can do it myself when merging.
f12dbd3
to
12a41b7
Compare
Description
enable()
anddisable()
on clickable components is only cosmetic. "Disabled" implies the control should not be functional.Specific Changes proposed
disable()
and add back onenable()
.enable
tabindex
from disabled components and adddisabled
attribute to disabled buttons to prevent keyboard access.Requirements Checklist