diff --git a/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js index 043d66742564a1..23833face664a9 100644 --- a/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js +++ b/packages/react-native/Libraries/IntersectionObserver/IntersectionObserverEntry.js @@ -66,10 +66,12 @@ export default class IntersectionObserverEntry { return 0; } - return ( + const ratio = (intersectionRect.width * intersectionRect.height) / - (boundingClientRect.width * boundingClientRect.height) - ); + (boundingClientRect.width * boundingClientRect.height); + + // Prevent rounding errors from making this value greater than 1. + return Math.min(ratio, 1); } /**