This commit is contained in:
Andrew Gundersen 2022-01-18 16:58:56 -06:00
commit 5d74c67648
17 changed files with 101 additions and 212 deletions

View file

@ -7,13 +7,11 @@ const initScroll = (elementId) => {
}
const isBottom = () => {
if (el) {
return el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
}
return el.scrollHeight - el.clientHeight <= el.scrollTop + 1;
}
const adjustScroll = () => {
if (el) {
if (isBottom()) {
el.scrollTo({
top: el.scrollHeight - el.clientHeight,
behavior: 'smooth'