chore: prettier all ts code
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
export function isHidden(element: HTMLElement) {
|
||||
const style = window.getComputedStyle(element);
|
||||
const isHidden = style.display === 'none';
|
||||
export function isHidden(el: HTMLElement) {
|
||||
const style = window.getComputedStyle(el);
|
||||
const hidden = style.display === 'none';
|
||||
|
||||
// offsetParent returns null in the following situations:
|
||||
// 1. The element or its parent element has the display property set to none.
|
||||
// 2. The element has the position property set to fixed
|
||||
const isParentHidden = element.offsetParent === null && style.position !== 'fixed';
|
||||
const parentHidden = el.offsetParent === null && style.position !== 'fixed';
|
||||
|
||||
return isHidden || isParentHidden;
|
||||
return hidden || parentHidden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user