Skip to content

getScrollParent doesn't work with ref, but works with id #303

@magicznyleszek

Description

@magicznyleszek

Describe the bug
I was trying to use getScrollParent using the method suggested in the documentation. It didn't work. But I think that the problem might be in the typings, not in the code itself. I was not able to do getScrollParent={() => this.scrollParentRef} as TypeScript was not satisfied with passing React ref thing. I tried getScrollParent={() => this.scrollParentRef.current}, but it didn't work. In one of the issues' comment I've found a suggestion to use document.getElementById and it fixed the problem.

To Reproduce
I don't want to spend more time on this, as it already took few hours to debug. I am mostly posting this issue for future archeologists who stumble upon this kinda dead project 🧟 👍

Expected behavior
I would expect this to work as documented 🤷 But the minimum fix for me would be to mention id usage in documentation 😇

Device (please complete the following information):

  • OS: MacOS 13.0.1 (22A400)
  • Browser Firefox 107.0.1 (64-bit)
  • Version "react-infinite-scroller": "^1.2.6"

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