Skip to content

The window.scrollY is a problems! #85

Description

@Weibozzz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions