So I'm writing some javascript¹ for a textbox that automatically scrolls when new content is added but only if you're already scrolled to the bottom, and I'm actually more than a little confused about how to detect I'm already at the bottom. What would be a lot easier, the way I'm doing this, is to detect that the bottom item is visible on screen, and to force a rescroll when a change occurs while bottom item is visible. So scrolling ALMOST to the bottom would "lock"

¹ okay, Rust. It's cursed

Replying to @nabijaczleweli@101010.pl

@nabijaczleweli do you think that would be better than this? mastodon.social/@mcc/116869331

mcc@mcc@mastodon.social

@eramdam how good an approach do you think this is? it seems "perfect" but i'm not sure if it's compatible with what i'm doing now (because what i'm doing now is modifying a scroller that blanks divs that are too far offscreen) css-tricks.com/books/greatest-