Browse Source

fixed issue when observer.options is undefined

Former-commit-id: c3ebd2f9039d5e97d861720a69535cb582fa9c29
Gildas 6 năm trước cách đây
mục cha
commit
491fa7872a
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;