react-simple-pull-to-refresh icon indicating copy to clipboard operation
react-simple-pull-to-refresh copied to clipboard

The `window.scrollY` is a problems!

Open Weibozzz opened this issue 2 years ago • 0 comments

your code

const getScrollToBottomValue = (): number => {
   if (!childrenRef || !childrenRef.current) return -1;
   const scrollTop = window.scrollY; // is the pixels hidden in top due to the scroll. With no scroll its value is 0.
   const scrollHeight = childrenRef.current.scrollHeight; // is the pixels of the whole container
   return scrollHeight - scrollTop - window.innerHeight;
 };

The window.scrollY !It is limited to being used only in the window. If a scroll bar appears at a maximum height on its outer layer, it will not work

Weibozzz avatar Oct 25 '23 08:10 Weibozzz