tree
tree copied to clipboard
Node expansion via drag event misses to async load tree data
Status Quo
The tree component is expanding the tree node, if the user has dragged over the tree node for longer time. Thus, the tree comonent is expanding this particular tree node, hence tree is showing the children of that tree node, as well.
Problem
The tree component does not ensure that the tree data is fetched, if lazy load is used, once the tree node is expanded via drag enter/over event.
Root cause
It seems only the expanded keys are updated and onExpand is getting called, see: https://github.com/react-component/tree/blob/22c5ace87f7c27a452b444a63e1a927488525520/src/Tree.tsx#L565
Solution Proposal
The onNodeExpand function should be called in case of expansion via drag event, like it is done for keyboard navigation or mouse-click event, since this ensures the async load.