react-dnd-treeview
react-dnd-treeview copied to clipboard
Add support to render a footer beneath the tree
Is your feature request related to a problem? Please describe. I'm currently using this library to implement a feature where to rootnodes in the tree are groups of entities and you can drag and drop each child node to those group. Thus being able to group the entities as desired. We ran into the problem of needing to render a footer for this component for totals of all the groups.
But because this library currently does not support the rendering of a footer element beneath al the rootnodes we implemented a workaround to use display flex
on the tree and order
on the footer element to put the footer element at the bottom.
Obviously this is a workaround since altering the order of elements on the screen without altering the order of those elements in the DOM is not accessibility friendly.
Describe the solution you'd like
Tree
component could accept a renderFooter
callback the is placed beneath the Container
that is currently rendered in the Tree
. As parameters it is given an array of the data contained in each Node
in the Tree
so the render function can use this as desired in the footer. (If this can result in performance issues due to the potential size of such an array maybe a more clever solution is needed)
Describe alternatives you've considered As described above, currently we use css to put our footer element beneath al the nodes.
Additional context Not feature request related but: English is not my native language (Dutch), please excuse any grammatical errors.