Skip to content

Commit 39e2460

Browse files
committed
tree: fix dnd auto expand timeout
1 parent 742e27c commit 39e2460

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/vs/base/browser/ui/tree/abstractTree.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@ class TreeNodeListDragAndDrop<T, TFilterData, TRef> implements IListDragAndDrop<
3737

3838
onDragOver(data: IDragAndDropData, targetNode: ITreeNode<T, TFilterData> | undefined, targetIndex: number | undefined, originalEvent: DragEvent, raw = true): boolean | IListDragOverReaction {
3939
const result = this.dnd.onDragOver(data, targetNode && targetNode.element, targetIndex, originalEvent);
40+
const didChangeAutoExpandNode = this.autoExpandNode !== targetNode;
4041

41-
if (typeof targetNode === 'undefined') {
42-
return result;
43-
}
44-
45-
if (this.autoExpandNode !== targetNode) {
42+
if (didChangeAutoExpandNode) {
4643
this.autoExpandDisposable.dispose();
4744
this.autoExpandNode = targetNode;
4845
}
4946

50-
if (typeof result !== 'boolean' && result.autoExpand) {
47+
if (typeof targetNode === 'undefined') {
48+
return result;
49+
}
50+
51+
if (didChangeAutoExpandNode && typeof result !== 'boolean' && result.autoExpand) {
5152
this.autoExpandDisposable = timeout(() => {
5253
const model = this.modelProvider();
5354
const ref = model.getNodeLocation(targetNode);

0 commit comments

Comments
 (0)