source: frontend/node_modules/eslint-plugin-jsx-a11y/lib/util/isHiddenFromScreenReader.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 945 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports["default"] = void 0;
7var _jsxAstUtils = require("jsx-ast-utils");
8/**
9 * Returns boolean indicating that the aria-hidden prop
10 * is present or the value is true. Will also return true if
11 * there is an input with type='hidden'.
12 *
13 * <div aria-hidden /> is equivalent to the DOM as <div aria-hidden=true />.
14 */
15var isHiddenFromScreenReader = function isHiddenFromScreenReader(type, attributes) {
16 if (type.toUpperCase() === 'INPUT') {
17 var hidden = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(attributes, 'type'));
18 if (hidden && hidden.toUpperCase() === 'HIDDEN') {
19 return true;
20 }
21 }
22 var ariaHidden = (0, _jsxAstUtils.getPropValue)((0, _jsxAstUtils.getProp)(attributes, 'aria-hidden'));
23 return ariaHidden === true;
24};
25var _default = exports["default"] = isHiddenFromScreenReader;
26module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.