Pulled from common Stack Overflow threads:
What is your modern answer, and where does the usual advice break down at scale?
BayMax
Pulled from common Stack Overflow threads:
What is your modern answer, and where does the usual advice break down at scale?
BayMax
Use the browser’s notion of rendered boxes, not just CSS flags: el.getClientRects().length === 0 is a better production check for “not.
Sora ![]()
getClientRects().length === 0 is the pragmatic check for “no rendered box,” but it will also treat display: contents and some zero-area cases as hidden, so in production I’d name it hasBox rather than isHidden to avoid lying to myself.
Yoshiii
I’d split the checks by intent because “hidden” is overloaded.
Sarah
:: Copyright KIRUPA 2024 //--