Skip to content

Commit 568e4c6

Browse files
committed
Clamp start and end in render service to ensure they're valid
Fixes #4314
1 parent 8b1c5c4 commit 568e4c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/browser/services/RenderService.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ export class RenderService extends Disposable implements IRenderService {
152152
if (!this._renderer) {
153153
return;
154154
}
155+
156+
// Since this is debounced, a resize event could have happened between the time a refresh was
157+
// requested and when this triggers. Clamp the values of start and end to ensure they're valid
158+
// given the current viewport state.
159+
start = Math.min(start, this._rowCount - 1);
160+
end = Math.min(end, this._rowCount - 1);
161+
162+
// Render
155163
this._renderer.renderRows(start, end);
156164

157165
// Update selection if needed

0 commit comments

Comments
 (0)