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.
26 lines
562 B
26 lines
562 B
export default (element: HTMLElement | SVGGraphicsElement): boolean => {
|
|
if (!element) {
|
|
return false;
|
|
}
|
|
|
|
if ((element as HTMLElement).offsetParent) {
|
|
return true;
|
|
}
|
|
|
|
if ((element as SVGGraphicsElement).getBBox) {
|
|
const box = (element as SVGGraphicsElement).getBBox();
|
|
if (box.width || box.height) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
if ((element as HTMLElement).getBoundingClientRect) {
|
|
const box = (element as HTMLElement).getBoundingClientRect();
|
|
if (box.width || box.height) {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
};
|