|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
974 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | "use strict";
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports["default"] = void 0;
|
|---|
| 7 | var _jsxAstUtils = require("jsx-ast-utils");
|
|---|
| 8 | var _getTabIndex = _interopRequireDefault(require("./getTabIndex"));
|
|---|
| 9 | var _isInteractiveElement = _interopRequireDefault(require("./isInteractiveElement"));
|
|---|
| 10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|---|
| 11 | /**
|
|---|
| 12 | * Returns boolean indicating whether an element appears in tab focus.
|
|---|
| 13 | * Identifies an element as focusable if it is an interactive element, or an element with a tabIndex greater than or equal to 0.
|
|---|
| 14 | */
|
|---|
| 15 | function isFocusable(type, attributes) {
|
|---|
| 16 | var tabIndex = (0, _getTabIndex["default"])((0, _jsxAstUtils.getProp)(attributes, 'tabIndex'));
|
|---|
| 17 | if ((0, _isInteractiveElement["default"])(type, attributes)) {
|
|---|
| 18 | return tabIndex === undefined || tabIndex >= 0;
|
|---|
| 19 | }
|
|---|
| 20 | return tabIndex >= 0;
|
|---|
| 21 | }
|
|---|
| 22 | var _default = exports["default"] = isFocusable;
|
|---|
| 23 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.