Skip to content

Commit

Permalink
@OwenEdwards improved handling of deprecated use of Button component. c…
Browse files Browse the repository at this point in the history
…loses #3236
  • Loading branch information
OwenEdwards authored and gkatsev committed Apr 5, 2016
1 parent 4849374 commit 0f40f3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* @OwenEdwards improved handling of deprecated use of Button component ([view](https://github.com/videojs/video.js/pull/3236))

--------------------

Expand Down
10 changes: 10 additions & 0 deletions src/js/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ class Button extends ClickableComponent {

if (tag !== 'button') {
log.warn(`Creating a Button with an HTML element of ${tag} is deprecated; use ClickableComponent instead.`);

// Add properties for clickable element which is not a native HTML button
props = assign({
tabIndex: 0
}, props);

// Add ARIA attributes for clickable element which is not a native HTML button
attributes = assign({
role: 'button'
}, attributes);
}

// Add attributes for button element
Expand Down

0 comments on commit 0f40f3f

Please sign in to comment.