Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix: remove IntersectionObserver shim #4808

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions assets/js/base/hooks/use-position-relative-to-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { useRef, useLayoutEffect, useState } from '@wordpress/element';
import { getIntersectionObserver } from '@woocommerce/base-utils';

/** @typedef {import('react')} React */

Expand Down Expand Up @@ -50,7 +49,7 @@ export const usePositionRelativeToViewport = () => {
] = useState( '' );
const referenceElementRef = useRef( null );
const intersectionObserver = useRef(
getIntersectionObserver(
new IntersectionObserver(
( entries ) => {
if ( entries[ 0 ].isIntersecting ) {
setPositionRelativeToViewport( 'visible' );
Expand Down
26 changes: 0 additions & 26 deletions assets/js/base/utils/get-intersection-observer.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/js/base/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export * from './address';
export * from './shipping-rates';
export * from './legacy-events';
export * from './render-frontend';
export * from './get-intersection-observer';
export * from './get-valid-block-attributes';
export * from './product-data';
export * from './derive-selected-shipping-rates';
Expand Down