frontend-collective / react-sortable-tree

Drag-and-drop sortable component for nested data and hierarchies
https://frontend-collective.github.io/react-sortable-tree/
MIT License
4.9k stars 897 forks source link

Tree not rendering at all when inside a Material UI Paper object.. crazy #900

Closed rchancey closed 3 years ago

rchancey commented 3 years ago

Reporting a Bug?

If I have the tree by itself it works fine.. if I wrap it run a Paper from Material UI.. the entire thing disappears.. including the Paper?

literally from this: <SortableTree treeData={treeData} maxDepth={3} theme={FileExplorerTheme} dndType={'recommendation'} canDrop={self.canDrop.bind(self)} generateNodeProps={self.getNodeProps.bind(self)} />

to this: `

` it stops rendering any idea why this would be the case? just maddening! :-(
nosferatu500 commented 3 years ago

I made a fork of this library. I think your issue also was resolved.

yarn add @nosferatu500/react-sortable-tree

Because I had the same problem with Ant Design and I solved it in my fork.

nosferatu500 commented 3 years ago

But it doesn't provide types for Typescript.

You can resolve it by following these steps: https://github.com/frontend-collective/react-sortable-tree/issues/855#issuecomment-866475264

rchancey commented 3 years ago

Thank you for responding.. I had the same issue with Div and I accidentally added a height and it worked. Somehow it won't render inside another element unless there is a height on the parent element.. perhaps the fix above addresses that but just wanted to share.