You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
504 B
24 lines
504 B
2 years ago
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.isVisible = isVisible;
|
||
|
|
||
|
var _helpers = require("@testing-library/dom/dist/helpers");
|
||
|
|
||
|
function isVisible(element) {
|
||
|
const window = (0, _helpers.getWindowFromNode)(element);
|
||
|
|
||
|
for (let el = element; (_el = el) != null && _el.ownerDocument; el = el.parentElement) {
|
||
|
var _el;
|
||
|
|
||
|
const display = window.getComputedStyle(el).display;
|
||
|
|
||
|
if (display === 'none') {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
}
|