Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class SiChatContainerComponent implements AfterContentInit, OnDestroy {
private scrollDebounceMs = 7; // ~144fps
private resizeObserver: ResizeObserver | undefined;
private contentObserver: MutationObserver | undefined;
private lastScrollHeight = 0;

/**
* The color variant to apply to the container.
Expand Down Expand Up @@ -145,9 +146,15 @@ export class SiChatContainerComponent implements AfterContentInit, OnDestroy {
}

this.resizeObserver = new ResizeObserver(() => {
this.debouncedScrollToBottom();
const element = container.nativeElement;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be doing this just to make our e2e pipeline happy unless its real valid use case

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spliffone made changes to the scroll behaviour, I'm not sure if that doesn't fix it already. #2105

const currentScrollHeight = element.scrollHeight;
if (currentScrollHeight > this.lastScrollHeight) {
this.debouncedScrollToBottom();
}
this.lastScrollHeight = currentScrollHeight;
});

this.lastScrollHeight = container.nativeElement.scrollHeight;
this.resizeObserver.observe(container.nativeElement);
}

Expand Down
Loading