Skip to content

Commit

Permalink
fix: revert changes to isFocusable. To be tackled by issue #1208
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeyyy committed Oct 28, 2018
1 parent 624ddbd commit 212d0da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/commons/dom/is-focusable.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
/**
* Determines if focusing has been disabled on an element.
* @param {HTMLElement} el The HTMLElement
* @param {Boolean} screenReader Default(true), When provided, will evaluate visibility from the perspective of a screen reader
* @return {Boolean} Whether focusing has been disabled on an element.
*/
function focusDisabled(el, screenReader = true) {
function focusDisabled(el) {
return (
el.disabled ||
(!dom.isVisible(el, screenReader) && el.nodeName.toUpperCase() !== 'AREA')
(!dom.isVisible(el, true) && el.nodeName.toUpperCase() !== 'AREA')
);
}

Expand All @@ -20,12 +19,12 @@ function focusDisabled(el, screenReader = true) {
* @memberof axe.commons.dom
* @instance
* @param {HTMLElement} el The HTMLElement
* @param {Boolean} screenReader Default(true), When provided, will evaluate visibility from the perspective of a screen reader
* @return {Boolean} The element's focusability status
*/

dom.isFocusable = function(el, screenReader = true) {
if (focusDisabled(el, screenReader)) {
dom.isFocusable = function(el) {
'use strict';
if (focusDisabled(el)) {
return false;
} else if (dom.isNativelyFocusable(el)) {
return true;
Expand Down

0 comments on commit 212d0da

Please sign in to comment.