scrollToBottom not scrolling to bottom
See original GitHub issueWhat I need Auto scroll through a table that is in a fixed container
What i’ve done I have a fixed height div (700px) containing a table of data. The height of the table is greater than the container and thus is scrollable (as planned). I wanted to auto scroll through the table contents using animateScroll.scrollToBottom(). This is not working 100%. The content of the div is scrolling but only for 700px of the content (so around 1/3). This is obviously something to do with the fixed height of the table but that cannot be changed>
Heres what I have
class LeaderBoard extends React.Component {
componentDidMount = () => {
scroll.scrollToBottom({
containerId: "scrollContainer",
duration: 3000,
delay: 2000,
smooth: "linear"
});
};
render() {
return (
<Panel ref={this.tableContainer} id="scrollContainer">
<Table>
<tbody>
{this.renderTableHeaders()} // generates th's
{this.renderTableRows()} / / generates tr's
</tbody>
</Table>
</Panel>
);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
ionic3 - Content Scroll to Bottom Not Working - Stack Overflow
The problem is that the scrollToBottom() code may run before the DOM is completely updated. Several solutions ...
Read more >scrollTo | Cypress Documentation
scrollTo('bottom ') // Scroll 'sidebar' to its bottom. Incorrect Usage. cy.title().scrollTo('My App') // Errors, 'title' does not yield DOM element ...
Read more >Scroll to Bottom of List in iOS 16… | Apple Developer Forums
I am using ScrollView instead of List inside ScrollViewReader and the scrolling does not work since iOS16.0. In 16.0, it seems to work...
Read more >Form will not scroll to bottom - Power Platform Community
Form will not scroll to bottom. 02-12-2020 08:19 AM. From SharePoint Online, I have selected "Customize Form" and created my form in PowerApps, ......
Read more >Automatic Scroll-To-Bottom in Flutter | smarx.com
Learn how to scroll to the bottom of a Flutter ListView when new items are added.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If my guess is correct don’t use the garbage scrolling methods from your framework here react, I have the same problem with framework ionic, instead use standard .scrollIntoView() it works nicely…
I set up two dummy hidden divs, top and bottom around my “content” like so
then fixed my scroll helper methods like so:
finally the actual scroll to id follows:
EDIT: I don’t believe that this fix illustrates the correct use of the
scrollToBottom()
function, so I would advise ignoring what I’ve written here. Leaving it for posterity, though…I experienced this issue as well - in my case, I was able to resolve it by wrapping the call to
scrollToBottom
in asetTimeout
with the second argument set to 0. Not sure why that helps, but I’ve bumped into this sort of thing before in other situations… woo front end!