Merge pull request #180738 from microsoft/aamunger/scrollingWhileStreaming

don't stick the scrollbar to the bottom if scrolled up
This commit is contained in:
Aaron Munger 2023-04-24 12:45:51 -07:00 committed by GitHub
commit af8b51ed1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -209,7 +209,8 @@ function initializeScroll(scrollableElement: HTMLElement, disposables: Disposabl
}
// Find the scrollTop of the existing scrollable output, return undefined if at the bottom or element doesn't exist
function findScrolledHeight(scrollableElement: HTMLElement): number | undefined {
function findScrolledHeight(container: HTMLElement): number | undefined {
const scrollableElement = container.querySelector(scrollableClass);
if (scrollableElement && scrollableElement.scrollHeight - scrollableElement.scrollTop - scrollableElement.clientHeight > 2) {
// not scrolled to the bottom
return scrollableElement.scrollTop;