Procházet zdrojové kódy

fixed issue when observer.options is undefined

Former-commit-id: c3ebd2f9039d5e97d861720a69535cb582fa9c29
Gildas před 6 roky
rodič
revize
491fa7872a
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      lib/hooks/content/content-hooks-frames-web.js

+ 1 - 1
lib/hooks/content/content-hooks-frames-web.js

@@ -127,7 +127,7 @@
 		dispatchEvent(new UIEvent("scroll"));
 		const docBoundingRect = scrollingElement.getBoundingClientRect();
 		Array.from(observers, ([intersectionObserver, observer]) => {
-			const rootBoundingRect = observer.options.root && observer.options.root.getBoundingClientRect();
+			const rootBoundingRect = observer.options && observer.options.root && observer.options.root.getBoundingClientRect();
 			observer.callback(observedElements.get(intersectionObserver).map(target => {
 				const boundingClientRect = target.getBoundingClientRect();
 				const isIntersecting = true;