Skip to content

Commit af8b51e

Browse files
authored
Merge pull request microsoft#180738 from microsoft/aamunger/scrollingWhileStreaming
don't stick the scrollbar to the bottom if scrolled up
2 parents 7d6225b + 59ef73f commit af8b51e

File tree

1 file changed

+2
-1
lines changed
  • extensions/notebook-renderers/src

1 file changed

+2
-1
lines changed

extensions/notebook-renderers/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ function initializeScroll(scrollableElement: HTMLElement, disposables: Disposabl
209209
}
210210

211211
// Find the scrollTop of the existing scrollable output, return undefined if at the bottom or element doesn't exist
212-
function findScrolledHeight(scrollableElement: HTMLElement): number | undefined {
212+
function findScrolledHeight(container: HTMLElement): number | undefined {
213+
const scrollableElement = container.querySelector(scrollableClass);
213214
if (scrollableElement && scrollableElement.scrollHeight - scrollableElement.scrollTop - scrollableElement.clientHeight > 2) {
214215
// not scrolled to the bottom
215216
return scrollableElement.scrollTop;

0 commit comments

Comments
 (0)