All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.utils.misc.isVisible.js Maven / Gradle / Ivy

The newest version!
"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;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy