Antd Treenode title and height css setting

ε祈祈猫儿з 提交于 2021-01-28 05:32:16

问题


I am using Antd v4.2.4 Tree (example: virtual scroll) from the link. I woulld like to use the virtual Scroll which can be used by setting "height" prop of the Tree. All is fine till here as in the example.

  • I would like to apply some css to the scrollbar like both overflowX and Y should be enabled on hover in the container
  • I would like have the Tree node show in only single line when the title is really big and not wrap it, if I use overflowX css, it doesn't work.

codesandbox

Update1: I see when we set "height" prop to Tree a lot of Divs have the inline css elements so not sure how to override them.

May be there is something small here but I am unable to figure out

I want to have such a look for my TreeNode and when hovered on this container the scrollbar X and Y is visible to see the longer node title please advice

update 2

if the set following css I am able to get the title in single line, but the scroll-X behaves strange. i.e. the scoll-x gets hidden when the Tree height/contents are big and when ypu collapse all treenodes, it shows up

.ant-tree .ant-tree-treenode {
  white-space: nowrap;
}

codesandbox

TIA

来源:https://stackoverflow.com/questions/61997238/antd-treenode-title-and-height-css-setting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!