fix(panel): column-reverse thread keeps the bottom, no island in the plugin
This commit is contained in:
@@ -79,20 +79,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
// The scroller is column-reverse: its origin is the bottom, scrollTop is
|
||||
// zero there and goes negative upward, and the browser keeps the view at
|
||||
// the bottom while content grows - no matter how late markdown lands.
|
||||
function nearBottom(): boolean {
|
||||
if (!scroller) {
|
||||
return true;
|
||||
}
|
||||
const left =
|
||||
scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight;
|
||||
return left < NEAR_BOTTOM_PX;
|
||||
return !scroller || Math.abs(scroller.scrollTop) < NEAR_BOTTOM_PX;
|
||||
}
|
||||
|
||||
function toBottom() {
|
||||
if (scroller) {
|
||||
scroller.scrollTop = scroller.scrollHeight;
|
||||
scroller.scrollTop = 0;
|
||||
}
|
||||
// Whatever actually scrolls - this box, or a host's pane around it.
|
||||
end?.scrollIntoView({ block: "end" });
|
||||
}
|
||||
|
||||
@@ -211,7 +208,7 @@
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-3 py-3 @md:px-6"
|
||||
class="flex min-h-0 flex-1 flex-col-reverse overflow-y-auto overflow-x-hidden px-3 py-3 @md:px-6"
|
||||
onscroll={() => {
|
||||
if (Date.now() > settleUntil) {
|
||||
pinned = nearBottom();
|
||||
|
||||
Reference in New Issue
Block a user