Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tree-view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TreeView
@element.tabIndex = -1

@list = document.createElement('ol')
@list.classList.add('full-menu', 'list-tree', 'has-collapsable-children', 'focusable-panel')
@list.classList.add('tree-view-root', 'full-menu', 'list-tree', 'has-collapsable-children', 'focusable-panel')
@element.appendChild(@list)

@disposables = new CompositeDisposable
Expand Down
18 changes: 9 additions & 9 deletions styles/tree-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
display: flex;
flex-direction: column;

.full-menu {
.tree-view-root {
padding-left: @component-icon-padding;
padding-right: @component-padding;
background-color: inherit;

/*
* Force a new stacking context to prevent a large, duplicate paint layer from
* being created for tree-view's scrolling contents that can make the cost of
Expand All @@ -26,18 +30,13 @@
* auto-created layer.
*/
isolation: isolate;
padding-left: @component-icon-padding;
padding-right: @component-padding;
background-color: inherit;

// Expands .full-menu to take up full height.
// Expands tree-view root to take up full height.
// This makes sure that the context menu can still be openend in the empty
// area underneath the files.
flex-grow: 1;
}

.full-menu.list-tree {
// Expands .full-menu to take up as much width as needed by the content.
// Expands tree-view root to take up as much width as needed by the content.
// This makes sure that the selected item's "bar/background" expands to full width.
position: relative;
min-width: min-content;
Expand All @@ -47,7 +46,8 @@
position: relative;
}

.list-tree {
.tree-view-root .list-tree {
// Keeps selections expanded while dragging
position: static;
}

Expand Down