framer-motion 12.11.0 → 12.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12489,8 +12489,10 @@
12489
12489
  const scrollListeners = new WeakMap();
12490
12490
  const resizeListeners = new WeakMap();
12491
12491
  const onScrollHandlers = new WeakMap();
12492
- const getEventTarget = (element) => element === document.documentElement ? window : element;
12493
- function scrollInfo(onScroll, { container = document.documentElement, ...options } = {}) {
12492
+ const getEventTarget = (element) => element === document.scrollingElement ? window : element;
12493
+ function scrollInfo(onScroll, { container = document.scrollingElement, ...options } = {}) {
12494
+ if (!container)
12495
+ return noop;
12494
12496
  let containerHandlers = onScrollHandlers.get(container);
12495
12497
  /**
12496
12498
  * Get the onScroll handlers for this container.
@@ -12621,17 +12623,9 @@
12621
12623
  }
12622
12624
  }
12623
12625
 
12624
- function scroll(onScroll, { axis = "y", container = document.documentElement, ...options } = {}) {
12625
- /**
12626
- * If the container is the document.documentElement and the scrollHeight
12627
- * and clientHeight are the same, we need to use the document.body instead
12628
- * as this is the scrollable document element.
12629
- */
12630
- if (container === document.documentElement &&
12631
- ((axis === "y" && container.scrollHeight === container.clientHeight) ||
12632
- (axis === "x" && container.scrollWidth === container.clientWidth))) {
12633
- container = document.body;
12634
- }
12626
+ function scroll(onScroll, { axis = "y", container = document.scrollingElement, ...options } = {}) {
12627
+ if (!container)
12628
+ return noop;
12635
12629
  const optionsWithDefaults = { axis, container, ...options };
12636
12630
  return typeof onScroll === "function"
12637
12631
  ? attachToFunction(onScroll, optionsWithDefaults)
@@ -12858,11 +12852,7 @@
12858
12852
  restSpeed: 0.01,
12859
12853
  ...config,
12860
12854
  onUpdate: latestSetter.current,
12861
- onComplete: () => {
12862
- value.isEffectActive = true;
12863
- },
12864
12855
  });
12865
- value.isEffectActive = false;
12866
12856
  };
12867
12857
  const stopAnimation = () => {
12868
12858
  if (activeSpringAnimation.current) {