@progress/kendo-angular-common
Version:
Kendo UI for Angular - Utility Package
18 lines (17 loc) • 900 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2020 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
;
Object.defineProperty(exports, "__esModule", { value: true });
var is_focusable_1 = require("./is-focusable");
var is_visible_1 = require("./is-visible");
exports.isFocusableWithTabKey = function (element, checkVisibility) {
if (checkVisibility === void 0) { checkVisibility = true; }
if (!is_focusable_1.isFocusable(element)) {
return false;
}
var tabIndex = element.getAttribute('tabIndex');
var visible = !checkVisibility || is_visible_1.isVisible(element);
return visible && tabIndex !== '-1';
};