From 558986144ce82aeb7903b9e3e751e3efb622f738 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 4 May 2017 10:11:35 -0700 Subject: [PATCH] Make list inherit its container's width Temporarily set its with to min-content when computing the preferred width --- lib/tree-view.coffee | 5 ++++- styles/tree-view.less | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tree-view.coffee b/lib/tree-view.coffee index 7188e4e2..4d023389 100644 --- a/lib/tree-view.coffee +++ b/lib/tree-view.coffee @@ -112,7 +112,10 @@ class TreeView isPermanentDockItem: -> true getPreferredWidth: -> - @list.offsetWidth + @list.style.width = 'min-content' + result = @list.offsetWidth + @list.style.width = '' + result onDirectoryCreated: (callback) -> @emitter.on('directory-created', callback) diff --git a/styles/tree-view.less b/styles/tree-view.less index 3a0043e9..ab5a0f6a 100644 --- a/styles/tree-view.less +++ b/styles/tree-view.less @@ -23,7 +23,6 @@ * auto-created layer. */ isolation: isolate; - width: min-content; padding-left: @component-icon-padding; padding-right: @component-padding; background-color: inherit;