You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a div which I add to its children dynamically and as the result its height changes. Once the content's height is changed, the vertical scrollbar will be able to move too far to the bottom, so much that the bar will be cut off by the frame as if it has gone underneath it. But if I resize the window, the recalculation done makes everything alright again.
Is there some way I can fix this problem from my end?
The text was updated successfully, but these errors were encountered:
then you can do something like this.refs.gemini.scrollbar.update();.
Let me know if that works for you.
Btw, how are you adding the children dynamically? shouldn't the componentDidUpdate method being run at that point? The scrollbar component should run the update itself when that method gets fired.
You are right, your code works fine if there's no animation involved. But since I add the new components with animation over a period of time and the animation affects the size of the content, that makes the problem. I mean if I remove the <ReactCSSTransitionGroup> element, the height is calculated perfectly.
Do you have any generic solution for content with animation? I mean I can come up with one for myself but I wonder if you've already solved it in a decent way!
The right approach would be using ReactTransitionGroup class and implement your own version of ReactCSSTransitionGroup so you can recalculate whatever you need once the animation is done. For the time being I took the dirty approach and just added a timer to call the update method after the animation is over.
I have a div which I add to its children dynamically and as the result its height changes. Once the content's height is changed, the vertical scrollbar will be able to move too far to the bottom, so much that the bar will be cut off by the frame as if it has gone underneath it. But if I resize the window, the recalculation done makes everything alright again.
Is there some way I can fix this problem from my end?
The text was updated successfully, but these errors were encountered: