Skip to content

Commit 6a58b40

Browse files
authored
Can't drag an item and drop it to an empty treeview (microsoft#151213)
Fixes microsoft#149890
1 parent a0a9b78 commit 6a58b40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/vs/workbench/browser/parts/views/treeView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,10 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
826826
const isTreeEmpty = !this.root.children || this.root.children.length === 0;
827827
// Hide tree container only when there is a message and tree is empty and not refreshing
828828
if (this._messageValue && isTreeEmpty && !this.refreshing) {
829-
this.treeContainer.classList.add('hide');
829+
// If there's a dnd controller then hiding the tree prevents it from being dragged into.
830+
if (!this.dragAndDropController) {
831+
this.treeContainer.classList.add('hide');
832+
}
830833
this.domNode.setAttribute('tabindex', '0');
831834
} else {
832835
this.treeContainer.classList.remove('hide');

0 commit comments

Comments
 (0)