fix unselect multiple entiries on right click#1115
Conversation
|
Nice. Can you please add a spec for this? |
|
When ever I try to run the tests on my machine I get
|
|
Did you |
|
That worked thank you |
|
Any word on this? @50Wliu is there a reason the |
|
Sorry for the delay. Finishing up my last few language-php PRs and working on a language-html PR, then I'll probably get to this. |
|
sounds good. thanks |
|
/cc @simurai: could you help with the above? ☝️ It looks like you added the Following diff seems to work, but I'm wondering if there's a better way. diff --git a/styles/tree-view.less b/styles/tree-view.less
index b0851a7..83db906 100644
--- a/styles/tree-view.less
+++ b/styles/tree-view.less
@@ -13,7 +13,7 @@
display: flex;
flex-direction: column;
- .full-menu {
+ .full-menu, .multi-select {
/*
* 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
@@ -30,14 +30,14 @@
padding-right: @component-padding;
background-color: inherit;
- // Expands .full-menu to take up full height.
+ // Expands .full-menu and .multi-select 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.
+ .full-menu.list-tree, .multi-select.list-tree {
+ // Expands .full-menu and .multi-select 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;
@@ -47,10 +47,6 @@
position: relative;
}
- .list-tree {
- position: static;
- }
-
.entry {
// This fixes #110, see that issue for more details
&::before { |
|
it seems like just using |
|
never mind |
Ouch.. 😩 Didn't realize that .list-tree {
position: static;
}is still needed when dragging.
Yes, added a new |
winstliu
left a comment
There was a problem hiding this comment.
Looks good. Just a few minor spec comments.
| button: 2 | ||
| }) | ||
|
|
||
| expect(treeView.getSelectedEntries().length).toBe(2); |
There was a problem hiding this comment.
How about another assertion to make sure that the multi-select class is present?
spec/tree-view-spec.js
Outdated
| treeView.showMultiSelectMenu() | ||
|
|
||
| let child = entries.children[0]; | ||
| while (child.children.length > 0 && (child = child.firstChild)); |
There was a problem hiding this comment.
Can this while loop be expanded?
|
Going to block this on #1130 to ensure that we don't forget about that. |
|
Hello everyone! Sorry for the question: when this functionality be in the new release? I waiting this almost 3 month and press context button on the keyboard (my context key almost destroyed because of this 😄 ) |
|
@mrveress kind of hacky but I am using this in atom now by doing the following steps:
Just make sure to uninstall that package and enable "tree-view" when it ships with this merged, or keep the forked branch up to date. |
|
FYI: PR #1130 is now merged. |
|
@UziTech please rebase and then I'll give this a final test run. |
|
All test passed 👍 💯 |
spec/tree-view-spec.js
Outdated
| const entries = treeView.roots[0].entries | ||
| treeView.selectEntry(entries.children[0]) | ||
| treeView.selectMultipleEntries(entries.children[1]) | ||
| treeView.showMultiSelectMenu() |
There was a problem hiding this comment.
To avoid explicitly stating this in the spec, is it possible to do a treeView.onMouseDown event on entries.children[1]?
|
👍 |


Description of the Change
fixes unselecting multiple entries when right clicking on a selected entry.