Open aprilmintacpineda opened 7 years ago
I guess it could be a problem if your child components don't have enougth heigh while initial rendering and then you update them dynamically. If I'm right could you try to scrollToY(0)
after that?
I solve this issue by adding a key to the Scrollbar component based on the content. For the example above for example, I would try
<ReactScrollbarJS key={this.props.related_posts.length} ...
to ensure that the scrollbar is re-rendered when new content is added.
Alain
@alaindresse unfortunately, your solution of adding a key prop to it doesn't work. I get the same output.
@UsulPro I honestly got confused with what you said, I am thinking that I should do scrollToY(0)
after dynamically loading the contents, but then how should I add that to my code since I'm doing all this in the return ()
.
can you guys please also attend to my other issue #14 because I always get that warning and it's kinda freaking me out.
@four-eyes-04-04 It's hard to check your code without full repo. If you show your project with this issue I could look at it
@UsulPro I really would love to but it's a private repo, I can't share any more codes with this issue...
When the page first loads, the vertical scrollbar is not present, it's just not there until you actually scrolls it that's the moment when the scrollbar appears.
Shouldn't it be visible even at first load?
here is how I did it.