Skip to content

Commit

Permalink
Fix ResizeObserver/IntersectionObserver in JSDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Sep 5, 2024
1 parent 74321b5 commit 8a6132d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mui-base/src/utils/useAnchorPositioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export function useAnchorPositioning(
// Keep `ancestorResize` for window resizing. TODO: determine the best configuration, or
// if we need to allow options.
ancestorScroll: trackAnchor,
elementResize: trackAnchor,
layoutShift: trackAnchor,
elementResize: trackAnchor && typeof ResizeObserver !== 'undefined',
layoutShift: trackAnchor && typeof IntersectionObserver !== 'undefined',
}),
nodeId,
});
Expand Down

0 comments on commit 8a6132d

Please sign in to comment.