Hey guys! Needed some assistance
I have a collection list of comments on my dashboard inside of a sidepanel. I disabled pagination as I was unsure on how to make the pagination dynamic so it changes based off the user’s screen height, and opted for all comments to load at once and use overflow to scroll through the comments
What i need help with is making sure that the list of comments is always scrolled to its bottom position, as in any messaging or comment front end the most recent message or comment is usually at the bottom, and users scroll up from there
I tested adding a javascript action on the button click that opens up this sidepanel, but it doesn’t seem the function properly
(Here’s that code)
document.addEventListener('DOMContentLoaded', function() {
var elem = document.getElementById('commentsContainer');
if (elem) elem.scrollTop = elem.scrollHeight;
}, false);
Ive also attached a screenshot of the sidepanel so you can see what the front end setup looks like a bit: