mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-25 00:44:05 +01:00
Let ListWidget's reveal take no action if the revealed element is already overflowing the viewport
Fix #78237
This commit is contained in:
@@ -1533,7 +1533,9 @@ export class List<T> implements ISpliceable<T>, IDisposable {
|
||||
const viewItemBottom = elementTop + elementHeight;
|
||||
const wrapperBottom = scrollTop + this.view.renderHeight;
|
||||
|
||||
if (elementTop < scrollTop) {
|
||||
if (elementTop < scrollTop && viewItemBottom >= wrapperBottom) {
|
||||
// The element is already overflowing the viewport, no-op
|
||||
} else if (elementTop < scrollTop) {
|
||||
this.view.setScrollTop(elementTop);
|
||||
} else if (viewItemBottom >= wrapperBottom) {
|
||||
this.view.setScrollTop(viewItemBottom - this.view.renderHeight);
|
||||
|
||||
Reference in New Issue
Block a user