Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplebar-react: recalculate() - Method Undefined on Ref Object #704

Open
Euclidean-Dev opened this issue Aug 8, 2024 · 0 comments
Open

Comments

@Euclidean-Dev
Copy link

Describe the bug
I am encountering an issue with simplebar-react where the recalculate() method does not seem to exist on the ref object as suggested by some parts of the documentation or community examples. This is causing difficulties in managing dynamic content sizes in React.

To Reproduce
Steps to reproduce the behavior:

  1. Go to my CodeSandbox example: EXAMPLE OF ISSUE HERE.
  2. Observe the console output after component mounts.
  3. Notice that the recalculate() method is undefined on the SimpleBar ref.

Expected behaviour
I expect to be able to call ref.current.recalculate() to adjust the scrollbar when the content size changes dynamically.

Actual behaviour*
The ref.current.recalculate() is undefined, and thus I cannot invoke this method to manage dynamic content changes.

Reproducible example
See codesandbox link above.

Additional context
N/A

Your environment

Software Version(s)
SimpleBar Latest
Browser Any
npm/Yarn n/a
Operating System Any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant