Skip to content

Commit

Permalink
Fix: inview return undefined when no element supplied (fixes #598)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Oct 23, 2024
1 parent fda4c9e commit 6522bd9
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 @@ -156,6 +156,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 6522bd9

Please sign in to comment.