-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Horizontal scrollbar for NTree #2875
Comments
This is an ugly hack that uses JavaScript to calculate related widths. I've opened an issue to request horizontal scrollbar for NTree: tusen-ai/naive-ui#2875
It seems that the scrollbar only works when a single label is too long, but not when the tree is too deep. |
So now it's not a feature request for a horizontal scrollbar, but a bug with the width of an NTree. Should I open a new issue for it? |
I haven't found the reason why tree node's width is incorrect. Discuss it in current issue is enough. |
It's quite wired, emmmmm. |
I've found the solution. |
If you need to fix it now, use the following workaround. .n-tree-node-indent::before {
content: "";
display: block;
width: 16px;
} |
Now when virtual scroll is enabled and NScrollbar is used, we need to scroll to the rightmost to see the vertical scrollbar. We need to either accept this behavior or use non-virtual scroll instead. NDataTable now supports virtual scroll with a horizontal scrollbar, it would be better if NTree can also support it. |
If we try to support it, scrollx must be specified. |
This function solves the problem (这个功能解决的问题)
When the tree is too wide, it's inconvenient to see the rightmost part.
And I failed to come up with a solution using
NScrollbar
because thewidth
of anNTree
is the width of its parent node instead of its real width.Expected API (期望的 API)
<n-tree scroll-x />
to add a horizontal scrollbar for the tree when it's too wide.The text was updated successfully, but these errors were encountered: