Trigger notebook list rerender when whitespace is dismissed.

This commit is contained in:
rebornix 2024-03-05 11:48:38 -08:00
parent e3e0fe00a3
commit c0300af60a
No known key found for this signature in database
GPG key ID: 181FC90D15393C20

View file

@ -295,8 +295,20 @@ export class NotebookCellListView<T> extends ListView<T> {
}
removeWhitespace(id: string): void {
this.notebookRangeMap.removeWhitespace(id);
this.eventuallyUpdateScrollDimensions();
const scrollTop = this.scrollTop;
const previousRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
const currentPosition = this.notebookRangeMap.getWhitespacePosition(id);
if (currentPosition > scrollTop) {
this.notebookRangeMap.removeWhitespace(id);
this.render(previousRenderRange, scrollTop, this.lastRenderHeight, undefined, undefined, false);
this._rerender(scrollTop, this.renderHeight, false);
this.eventuallyUpdateScrollDimensions();
} else {
this.notebookRangeMap.removeWhitespace(id);
this.eventuallyUpdateScrollDimensions();
}
}
getWhitespacePosition(id: string): number {