Skip to content

Commit

Permalink
Fix: inview return undefined when no element supplied (fixes #598) (#599
Browse files Browse the repository at this point in the history
)
  • Loading branch information
oliverfoster authored Oct 28, 2024
1 parent 151079f commit 292a1a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/inview.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
return locks.includes(name);
}
function getMeasurement (element) {
if (!element?.getBoundingClientRect) return;
const offset = element.getBoundingClientRect();
const height = offset.height;
const width = offset.width;
Expand Down

0 comments on commit 292a1a8

Please sign in to comment.