mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Let ListWidget's reveal take no action if the revealed element is already overflowing the viewport
Fix #78237
This commit is contained in:
parent
a9640d05a2
commit
dfaff021a8
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue