Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete root folder #90

Open
ErnestoLopez opened this issue May 3, 2023 · 2 comments
Open

delete root folder #90

ErnestoLopez opened this issue May 3, 2023 · 2 comments

Comments

@ErnestoLopez
Copy link

ErnestoLopez commented May 3, 2023

First of all, thanks a lot for this great job !!!

Is it possible to remove the root folder?

Or, in other words, can we define multiple root-level folders?

Thank you.

@shunjizhan
Copy link
Owner

hey, unfortunately there is no way to do that for the current version, where there has to be one root. Maybe try to do some css trick to hide the root?

You may also fork https://github.com/shunjizhan/use-tree-state and modify the data shape to accept multiple root, shouldn't be too complex, just change shape from { ...data } to [{ ...data }], so it's a superset of current shape.

@ErnestoLopez
Copy link
Author

ErnestoLopez commented May 9, 2023

thanks for your attention

In fact, while I was waiting to see if there was a solution through "tree folder" I had already modified the css.

In case it helps anyone, here's how...

.TreeNode { &:first-child { .CheckBox, .caretContainer, .typeIconContainer { display:none; } .TreeNodeToolBar { .EditIcon, .DeleteIcon, .AddFileIcon{ display:none; } } } &:not(:first-child) { position:relative; left:-10px; } }

...which doesn't completely delete the root folder, because I want new folders to be able to be created from it, but it does remove "tab" and some other icon.

  • Sorry for the format of the code but I have entered it well formatted and github shows it in 2 lines.

Greetings,

Ernesto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants