Skip to content

Commit 4e98d4b

Browse files
committed
Merge branch 'main' into aiday/indentationTestsAccrossDifferentLanguages
2 parents 4a8c50e + 9b50825 commit 4e98d4b

File tree

32 files changed

+603
-186
lines changed

32 files changed

+603
-186
lines changed

src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class BreadcrumbsWidget {
5757
private _focusedItemIdx: number = -1;
5858
private _selectedItemIdx: number = -1;
5959

60+
private _pendingDimLayout: IDisposable | undefined;
6061
private _pendingLayout: IDisposable | undefined;
6162
private _dimension: dom.Dimension | undefined;
6263

@@ -100,6 +101,7 @@ export class BreadcrumbsWidget {
100101
dispose(): void {
101102
this._disposables.dispose();
102103
this._pendingLayout?.dispose();
104+
this._pendingDimLayout?.dispose();
103105
this._onDidSelectItem.dispose();
104106
this._onDidFocusItem.dispose();
105107
this._onDidChangeFocus.dispose();
@@ -112,11 +114,12 @@ export class BreadcrumbsWidget {
112114
if (dim && dom.Dimension.equals(dim, this._dimension)) {
113115
return;
114116
}
115-
this._pendingLayout?.dispose();
116117
if (dim) {
117118
// only measure
118-
this._pendingLayout = this._updateDimensions(dim);
119+
this._pendingDimLayout?.dispose();
120+
this._pendingDimLayout = this._updateDimensions(dim);
119121
} else {
122+
this._pendingLayout?.dispose();
120123
this._pendingLayout = this._updateScrollbar();
121124
}
122125
}

src/vs/base/browser/ui/list/listView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { DataTransfers, IDragAndDropData } from 'vs/base/browser/dnd';
7-
import { $, addDisposableListener, animate, Dimension, getContentHeight, getContentWidth, getTopLeftOffset, getWindow, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';
7+
import { $, addDisposableListener, animate, Dimension, getContentHeight, getContentWidth, getTopLeftOffset, getWindow, isAncestor, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';
88
import { DomEmitter } from 'vs/base/browser/event';
99
import { IMouseWheelEvent } from 'vs/base/browser/mouseEvent';
1010
import { EventType as TouchEventType, Gesture, GestureEvent } from 'vs/base/browser/touch';
@@ -1517,6 +1517,9 @@ export class ListView<T> implements IListView<T> {
15171517
if (item.row) {
15181518
item.row.domNode.style.height = '';
15191519
item.size = item.row.domNode.offsetHeight;
1520+
if (item.size === 0 && !isAncestor(item.row.domNode, getWindow(item.row.domNode).document.body)) {
1521+
console.warn('Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!');
1522+
}
15201523
item.lastDynamicHeightWidth = this.renderWidth;
15211524
return item.size - size;
15221525
}

0 commit comments

Comments
 (0)